public class FSBackend extends AbstractSharedBackend
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FS_BACKEND_PATH |
| Constructor and Description |
|---|
FSBackend() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMetadataRecord(java.io.File input,
java.lang.String name)
Adds a metadata record with the specified name
|
void |
addMetadataRecord(java.io.InputStream input,
java.lang.String name)
Adds a metadata record with the specified name
|
void |
close()
Close backend and release resources like database connection if any.
|
void |
deleteAllMetadataRecords(java.lang.String prefix)
Deletes all the metadata records with the specified prefix.
|
boolean |
deleteMetadataRecord(java.lang.String name)
Deletes the metadata record with the specified name
|
void |
deleteRecord(DataIdentifier identifier)
Delete record identified by identifier.
|
boolean |
exists(DataIdentifier identifier)
This method check the existence of record in backend.
|
java.util.Iterator<DataIdentifier> |
getAllIdentifiers()
Returns identifiers of all records that exists in backend.
|
java.util.List<DataRecord> |
getAllMetadataRecords(java.lang.String prefix)
Gets all the metadata with a specified prefix.
|
java.util.Iterator<DataRecord> |
getAllRecords()
Returns a list of all DataRecords
|
DataRecord |
getMetadataRecord(java.lang.String name)
Gets the metadata of the specified name.
|
byte[] |
getOrCreateReferenceKey()
Returns the reference key of this backend.
|
DataRecord |
getRecord(DataIdentifier identifier)
Gets the record with the specified identifier
|
void |
init()
Initialize
|
boolean |
metadataRecordExists(java.lang.String name)
Checks if the metadata record with the specified name exists.
|
java.io.InputStream |
read(DataIdentifier identifier)
Return inputstream of record identified by identifier.
|
void |
setProperties(java.util.Properties properties)
Properties used to configure the backend.
|
void |
write(DataIdentifier identifier,
java.io.File file)
Stores file to backend with identifier used as key.
|
public static final java.lang.String FS_BACKEND_PATH
public void init()
throws DataStoreException
SharedBackendDataStoreExceptionpublic java.io.InputStream read(DataIdentifier identifier) throws DataStoreException
SharedBackendidentifier - identifier of record.DataStoreException - if record not found or any error.public void write(DataIdentifier identifier, java.io.File file) throws DataStoreException
SharedBackendidentifier - key of the filefile - file that would be stored in backend.DataStoreException - for any error.public DataRecord getRecord(DataIdentifier identifier) throws DataStoreException
SharedBackendidentifier - the record identifierDataStoreExceptionpublic java.util.Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
SharedBackendDataStoreExceptionpublic boolean exists(DataIdentifier identifier) throws DataStoreException
SharedBackendidentifier - identifier to be checked.DataStoreExceptionpublic void deleteRecord(DataIdentifier identifier) throws DataStoreException
SharedBackendDataStoreExceptionpublic void addMetadataRecord(java.io.InputStream input,
java.lang.String name)
throws DataStoreException
SharedBackendinput - the record input streamname - the nameDataStoreExceptionpublic void addMetadataRecord(java.io.File input,
java.lang.String name)
throws DataStoreException
SharedBackendinput - the record filename - the nameDataStoreExceptionpublic DataRecord getMetadataRecord(java.lang.String name)
SharedBackendname - the name of the recordpublic java.util.List<DataRecord> getAllMetadataRecords(java.lang.String prefix)
SharedBackendprefix - the prefix of the records to retrievepublic boolean deleteMetadataRecord(java.lang.String name)
SharedBackendname - the name of the recordpublic void deleteAllMetadataRecords(java.lang.String prefix)
SharedBackendprefix - the prefix of the recordpublic boolean metadataRecordExists(java.lang.String name)
SharedBackendname - the name of the recordpublic java.util.Iterator<DataRecord> getAllRecords()
SharedBackendpublic void close()
throws DataStoreException
SharedBackendDataStoreExceptionpublic byte[] getOrCreateReferenceKey()
throws DataStoreException
AbstractSharedBackendThis method is called only once during the lifetime of a backend instance and the return value is cached in memory, so it's no problem if the implementation is slow.
getOrCreateReferenceKey in class AbstractSharedBackendDataStoreException - if the key is not availablepublic void setProperties(java.util.Properties properties)
init() is invoked.properties - to configure BackendCopyright © 2010 - 2023 Adobe. All Rights Reserved