public class DirectoryBasedRepositoryReader extends Object implements RepositoryReader
All files in the directory must be digital object serializations, and none may have the same PID. This is verified upon construction.
Note: This implementation does not recognize when files are added to the directory. What is in the directory at construction-time is what is assumed to be the extent of the repository for the life of the object.
| Constructor and Description |
|---|
DirectoryBasedRepositoryReader(File directory,
DOTranslator translator,
String exportFormat,
String storageFormat,
String encoding)
Initializes the RepositoryReader by looking at all files in the provided
directory and ensuring that they're all serialized digital objects and
that there are no PID conflicts.
|
| Modifier and Type | Method and Description |
|---|---|
DOReader |
getReader(boolean UseCachedObject,
Context context,
String pid)
Gets a digital object reader.
|
ServiceDefinitionReader |
getServiceDefinitionReader(boolean UseCachedObject,
Context context,
String pid) |
ServiceDeploymentReader |
getServiceDeploymentReader(boolean UseCachedObject,
Context context,
String pid) |
String[] |
listObjectPIDs(Context context)
Gets a list of PIDs (accessible in the given context) of all objects in
the repository.
|
public DirectoryBasedRepositoryReader(File directory, DOTranslator translator, String exportFormat, String storageFormat, String encoding) throws StorageDeviceException, ObjectIntegrityException, StreamIOException, UnsupportedTranslationException, ServerException
directory - the directory where this repository is based.translator - the serialization/deserialization engine for objects.exportFormat - the format to use for export requests.storageFormat - the format of the objects on disk.encoding - The character encoding used across all formats.StorageDeviceExceptionObjectIntegrityExceptionStreamIOExceptionUnsupportedTranslationExceptionServerExceptionpublic DOReader getReader(boolean UseCachedObject, Context context, String pid) throws ObjectIntegrityException, ObjectNotFoundException, StreamIOException, UnsupportedTranslationException, ServerException
RepositoryReadergetReader in interface RepositoryReadercontext - The context of this request.pid - The PID of the object.ServerException - If anything went wrong.ObjectIntegrityExceptionObjectNotFoundExceptionStreamIOExceptionUnsupportedTranslationExceptionpublic ServiceDeploymentReader getServiceDeploymentReader(boolean UseCachedObject, Context context, String pid) throws ObjectIntegrityException, ObjectNotFoundException, StreamIOException, UnsupportedTranslationException, ServerException
getServiceDeploymentReader in interface RepositoryReaderObjectIntegrityExceptionObjectNotFoundExceptionStreamIOExceptionUnsupportedTranslationExceptionServerExceptionpublic ServiceDefinitionReader getServiceDefinitionReader(boolean UseCachedObject, Context context, String pid) throws ObjectIntegrityException, ObjectNotFoundException, StreamIOException, UnsupportedTranslationException, ServerException
getServiceDefinitionReader in interface RepositoryReaderObjectIntegrityExceptionObjectNotFoundExceptionStreamIOExceptionUnsupportedTranslationExceptionServerExceptionpublic String[] listObjectPIDs(Context context)
RepositoryReaderlistObjectPIDs in interface RepositoryReaderCopyright © 2013 DuraSpace. All Rights Reserved.