public class ResourceRepositoryImpl extends java.lang.Object implements ResourceRepository
Modifier and Type | Class and Description |
---|---|
static class |
ResourceRepositoryImpl.FileLayout
Class maintains the info stored in the text file in the cnf directory
that holds our contents.
|
ResourceRepository.Listener, ResourceRepository.ResourceRepositoryEvent, ResourceRepository.TYPE
Modifier and Type | Field and Description |
---|---|
protected static RepositoryPlugin.DownloadListener[] |
EMPTY_LISTENER |
FILENAME
Constructor and Description |
---|
ResourceRepositoryImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.String repoId,
SearchableRepository.ResourceDescriptor rd)
Add a resource descriptor to the index.
|
void |
addListener(ResourceRepository.Listener rrl)
Add a new event listener
|
boolean |
delete(java.lang.String repoId,
byte[] id) |
boolean |
deleteCache(byte[] id)
Delete a cache entry
|
java.util.List<ResourceDescriptorImpl> |
filter(java.lang.String repoId,
java.lang.String filter)
List the resources.
|
java.util.SortedSet<SearchableRepository.ResourceDescriptor> |
find(java.lang.String repoId,
java.lang.String bsn,
VersionRange range) |
java.io.File |
getCacheDir(java.lang.String name) |
java.io.File |
getResource(byte[] rd,
RepositoryPlugin.DownloadListener... blockers)
Get the file belonging to a Resource Descriptor
|
ResourceDescriptorImpl |
getResourceDescriptor(byte[] rd)
List the resources.
|
void |
removeListener(ResourceRepository.Listener rrl)
Remove an event listener
|
void |
setCache(java.io.File cache) |
void |
setExecutor(java.util.concurrent.Executor executor) |
void |
setIndexFile(java.io.File file) |
void |
setReporter(aQute.service.reporter.Reporter processor) |
void |
setURLConnector(URLConnectionHandler connector) |
java.lang.String |
toString() |
protected static final RepositoryPlugin.DownloadListener[] EMPTY_LISTENER
public java.util.List<ResourceDescriptorImpl> filter(java.lang.String repoId, java.lang.String filter) throws java.lang.Exception
filter
in interface ResourceRepository
filter
- An OSGi filter matched against the SearchableRepository.ResourceDescriptor
java.lang.Exception
public boolean delete(java.lang.String repoId, byte[] id) throws java.lang.Exception
delete
in interface ResourceRepository
java.lang.Exception
public boolean deleteCache(byte[] id) throws java.lang.Exception
deleteCache
in interface ResourceRepository
java.lang.Exception
public boolean add(java.lang.String repoId, SearchableRepository.ResourceDescriptor rd) throws java.lang.Exception
add
in interface ResourceRepository
java.lang.Exception
public java.io.File getResource(byte[] rd, RepositoryPlugin.DownloadListener... blockers) throws java.lang.Exception
getResource
in interface ResourceRepository
java.lang.Exception
public void addListener(ResourceRepository.Listener rrl)
addListener
in interface ResourceRepository
public void removeListener(ResourceRepository.Listener rrl)
public ResourceDescriptorImpl getResourceDescriptor(byte[] rd) throws java.lang.Exception
getResourceDescriptor
in interface ResourceRepository
java.lang.Exception
public void setReporter(aQute.service.reporter.Reporter processor)
public void setIndexFile(java.io.File file)
public void setCache(java.io.File cache)
public void setExecutor(java.util.concurrent.Executor executor) throws java.lang.Exception
java.lang.Exception
public void setURLConnector(URLConnectionHandler connector) throws java.lang.Exception
java.lang.Exception
public java.util.SortedSet<SearchableRepository.ResourceDescriptor> find(java.lang.String repoId, java.lang.String bsn, VersionRange range) throws java.lang.Exception
find
in interface ResourceRepository
java.lang.Exception
public java.io.File getCacheDir(java.lang.String name)
getCacheDir
in interface ResourceRepository
public java.lang.String toString()
toString
in class java.lang.Object