public class FSBackend extends AbstractBackend
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FS_BACKEND_PATH |
| Constructor and Description |
|---|
FSBackend() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<DataIdentifier> |
deleteAllOlderThan(long min)
Delete all records which are older than timestamp.
|
void |
deleteRecord(DataIdentifier identifier)
Delete record identified by identifier.
|
boolean |
exists(DataIdentifier identifier)
This method check the existence of record in backend.
|
boolean |
exists(DataIdentifier identifier,
boolean touch)
This method check the existence of record in backend.
|
java.util.Iterator<DataIdentifier> |
getAllIdentifiers()
Returns identifiers of all records that exists in backend.
|
long |
getLastModified(DataIdentifier identifier)
Return lastModified of record identified by identifier.
|
long |
getLength(DataIdentifier identifier)
Return length of record identified by identifier.
|
void |
init(CachingDataStore store,
java.lang.String homeDir,
java.util.Properties prop) |
void |
init(CachingDataStore store,
java.lang.String homeDir,
java.lang.String config)
This method initialize backend with the configuration.
|
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 |
touch(DataIdentifier identifier,
long minModifiedDate)
Update the lastModified of record if it's lastModified < minModifiedDate.
|
void |
touchAsync(DataIdentifier identifier,
long minModifiedDate,
AsyncTouchCallback callback)
Update the lastModified of record if it's lastModified < minModifiedDate
asynchronously.
|
void |
write(DataIdentifier identifier,
java.io.File src)
Stores file to backend with identifier used as key.
|
void |
writeAsync(DataIdentifier identifier,
java.io.File src,
AsyncUploadCallback callback)
Write file to backend in asynchronous mode.
|
close, getAsyncWritePoolSize, setAsyncWritePoolSizepublic static final java.lang.String FS_BACKEND_PATH
public void init(CachingDataStore store, java.lang.String homeDir, java.lang.String config) throws DataStoreException
AbstractBackendinit in interface Backendinit in class AbstractBackendstore - CachingDataStorehomeDir - path of repository home dir.config - path of config property file.DataStoreExceptionpublic void init(CachingDataStore store, java.lang.String homeDir, java.util.Properties prop) throws DataStoreException
DataStoreExceptionpublic java.io.InputStream read(DataIdentifier identifier) throws DataStoreException
Backendidentifier - identifier of record.DataStoreException - if record not found or any error.public long getLength(DataIdentifier identifier) throws DataStoreException
Backendidentifier - identifier of record.DataStoreException - if record not found or any error.public long getLastModified(DataIdentifier identifier) throws DataStoreException
Backendidentifier - identifier of record.DataStoreException - if record not found or any error.public void write(DataIdentifier identifier, java.io.File src) throws DataStoreException
Backendidentifier - key of the filesrc - file that would be stored in backend.DataStoreException - for any error.public void writeAsync(DataIdentifier identifier, java.io.File src, AsyncUploadCallback callback) throws DataStoreException
Backendcallback - Callback interface to called after upload succeed or failed.DataStoreExceptionpublic java.util.Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
BackendDataStoreExceptionpublic boolean exists(DataIdentifier identifier, boolean touch) throws DataStoreException
BackendDataStoreExceptionpublic boolean exists(DataIdentifier identifier) throws DataStoreException
Backendidentifier - identifier to be checked.DataStoreExceptionpublic void touch(DataIdentifier identifier, long minModifiedDate) throws DataStoreException
BackendDataStoreExceptionpublic void touchAsync(DataIdentifier identifier, long minModifiedDate, AsyncTouchCallback callback) throws DataStoreException
BackendAsyncTouchCallback methods. If identifier's lastModified >
minModified AsyncTouchCallback.onAbort(AsyncTouchResult) is
called. Any exception is communicated through
AsyncTouchCallback.onFailure(AsyncTouchResult) . On successful
update of lastModified,
AsyncTouchCallback.onSuccess(AsyncTouchResult)
is invoked.DataStoreExceptionpublic java.util.Set<DataIdentifier> deleteAllOlderThan(long min) throws DataStoreException
BackendSet of identifiers which are deleted.DataStoreExceptionpublic void deleteRecord(DataIdentifier identifier) throws DataStoreException
BackendDataStoreExceptionpublic void setProperties(java.util.Properties properties)
properties - to configure S3BackendCopyright © 2010 - 2023 Adobe. All Rights Reserved