public class FilesystemRepository extends AbstractRepository implements Repository
Constructor and Description |
---|
FilesystemRepository(java.io.File root) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the repository and release all resources.
|
DigitalObject |
createDigitalObject(java.lang.String handle)
Creates a new digital object with the given identifier in this repository.
|
static byte |
decodeHexByte(byte ch1,
byte ch2) |
void |
deleteDigitalObject(java.lang.String handle)
Deletes a digital object from the repository.
|
DigitalObject |
getDigitalObject(java.lang.String handle)
Returns the digital object with the given identifier from this repository.
|
CloseableIterator<java.lang.String> |
listHandles()
Provides a CloseableIterator view of the identifiers for digital objects accessible through this repository.
|
CloseableIterator<DigitalObject> |
listObjects()
Provides a CloseableIterator view of the digital objects accessible through this repository.
|
void |
lock(boolean shared) |
CloseableIterator<DigitalObject> |
search(Query query)
Provides a CloseableIterator view of the digital objects accessible through this repository under search bounds defined in the Query object with default parameters.
|
CloseableIterator<java.lang.String> |
searchHandles(Query query)
Provides a CloseableIterator view of the digital objects handles accessible through this repository under search bounds defined in the Query object with default parameters.
|
void |
unlock() |
boolean |
verifyDigitalObject(java.lang.String handle)
Verifies whether a digital object with the given identifier can be accessed via this repository.
|
getHandle, getOrCreateDigitalObject, search, search, searchHandles, searchHandles, searchMapping
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHandle, getOrCreateDigitalObject, search, search, searchHandles, searchHandles, searchMapping
public boolean verifyDigitalObject(java.lang.String handle) throws RepositoryException
Repository
verifyDigitalObject
in interface Repository
verifyDigitalObject
in class AbstractRepository
handle
- an identifier for a digital objectRepositoryException
public DigitalObject createDigitalObject(java.lang.String handle) throws CreationException, RepositoryException
Repository
null
requests that the repository assign a new unique identifier;
this method will throw UnsupportedOperationException
if the given repository does not support that functionality.createDigitalObject
in interface Repository
handle
- the identifier for the new digital object, or null
to request that the repository assign a new unique identifier.CreationException
- if an object with the given identifier already exists within the repositoryRepositoryException
public DigitalObject getDigitalObject(java.lang.String handle) throws RepositoryException
Repository
getDigitalObject
in interface Repository
handle
- the identifier for the digital objectRepositoryException
public void deleteDigitalObject(java.lang.String handle) throws RepositoryException
Repository
deleteDigitalObject
in interface Repository
deleteDigitalObject
in class AbstractRepository
handle
- the identifier for the digital objectRepositoryException
public CloseableIterator<java.lang.String> listHandles()
Repository
listHandles
in interface Repository
listHandles
in class AbstractRepository
public CloseableIterator<DigitalObject> listObjects() throws RepositoryException
Repository
listObjects
in interface Repository
listObjects
in class AbstractRepository
RepositoryException
public static final byte decodeHexByte(byte ch1, byte ch2)
public void close()
Repository
close
in interface Repository
public CloseableIterator<DigitalObject> search(Query query) throws RepositoryException
Repository
search
in interface Repository
search
in class AbstractRepository
query
- the query to performQueryResults
.RepositoryException
public CloseableIterator<java.lang.String> searchHandles(Query query) throws RepositoryException
Repository
searchHandles
in interface Repository
searchHandles
in class AbstractRepository
query
- the query to performQueryResults
.RepositoryException
public void lock(boolean shared) throws RepositoryException
RepositoryException
public void unlock()