Package org.apache.jackrabbit.core.data
Class FSBackend
- java.lang.Object
- 
- org.apache.jackrabbit.core.data.AbstractBackend
- 
- org.apache.jackrabbit.core.data.FSBackend
 
 
- 
- All Implemented Interfaces:
- Backend
 
 public class FSBackend extends AbstractBackend 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringFS_BACKEND_PATH
 - 
Constructor SummaryConstructors Constructor Description FSBackend()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<DataIdentifier>deleteAllOlderThan(long min)Delete all records which are older than timestamp.voiddeleteRecord(DataIdentifier identifier)Delete record identified by identifier.booleanexists(DataIdentifier identifier)This method check the existence of record in backend.booleanexists(DataIdentifier identifier, boolean touch)This method check the existence of record in backend.Iterator<DataIdentifier>getAllIdentifiers()Returns identifiers of all records that exists in backend.longgetLastModified(DataIdentifier identifier)Return lastModified of record identified by identifier.longgetLength(DataIdentifier identifier)Return length of record identified by identifier.voidinit(CachingDataStore store, String homeDir, String config)This method initialize backend with the configuration.voidinit(CachingDataStore store, String homeDir, Properties prop)InputStreamread(DataIdentifier identifier)Return inputstream of record identified by identifier.voidsetProperties(Properties properties)Properties used to configure the backend.voidtouch(DataIdentifier identifier, long minModifiedDate)Update the lastModified of record if it's lastModified < minModifiedDate.voidtouchAsync(DataIdentifier identifier, long minModifiedDate, AsyncTouchCallback callback)Update the lastModified of record if it's lastModified < minModifiedDate asynchronously.voidwrite(DataIdentifier identifier, File src)Stores file to backend with identifier used as key.voidwriteAsync(DataIdentifier identifier, File src, AsyncUploadCallback callback)Write file to backend in asynchronous mode.- 
Methods inherited from class org.apache.jackrabbit.core.data.AbstractBackendclose, createAsyncWriteExecutor, getAsyncWriteExecutor, getAsyncWritePoolSize, getConfig, getDataStore, getHomeDir, setAsyncWritePoolSize, setConfig, setDataStore, setHomeDir
 
- 
 
- 
- 
- 
Field Detail- 
FS_BACKEND_PATHpublic static final String FS_BACKEND_PATH - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
initpublic void init(CachingDataStore store, String homeDir, String config) throws DataStoreException Description copied from class:AbstractBackendThis method initialize backend with the configuration.- Specified by:
- initin interface- Backend
- Overrides:
- initin class- AbstractBackend
- Parameters:
- store-- CachingDataStore
- homeDir- path of repository home dir.
- config- path of config property file.
- Throws:
- DataStoreException
 
 - 
initpublic void init(CachingDataStore store, String homeDir, Properties prop) throws DataStoreException - Throws:
- DataStoreException
 
 - 
readpublic InputStream read(DataIdentifier identifier) throws DataStoreException Description copied from interface:BackendReturn inputstream of record identified by identifier.- Parameters:
- identifier- identifier of record.
- Returns:
- inputstream of the record.
- Throws:
- DataStoreException- if record not found or any error.
 
 - 
getLengthpublic long getLength(DataIdentifier identifier) throws DataStoreException Description copied from interface:BackendReturn length of record identified by identifier.- Parameters:
- identifier- identifier of record.
- Returns:
- length of the record.
- Throws:
- DataStoreException- if record not found or any error.
 
 - 
getLastModifiedpublic long getLastModified(DataIdentifier identifier) throws DataStoreException Description copied from interface:BackendReturn lastModified of record identified by identifier.- Parameters:
- identifier- identifier of record.
- Returns:
- lastModified of the record.
- Throws:
- DataStoreException- if record not found or any error.
 
 - 
writepublic void write(DataIdentifier identifier, File src) throws DataStoreException Description copied from interface:BackendStores file to backend with identifier used as key. If key pre-exists, it updates the timestamp of the key.- Parameters:
- identifier- key of the file
- src- file that would be stored in backend.
- Throws:
- DataStoreException- for any error.
 
 - 
writeAsyncpublic void writeAsync(DataIdentifier identifier, File src, AsyncUploadCallback callback) throws DataStoreException Description copied from interface:BackendWrite file to backend in asynchronous mode.- callback- Callback interface to called after upload succeed or failed.
- Throws:
- DataStoreException
 
 - 
getAllIdentifierspublic Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException Description copied from interface:BackendReturns identifiers of all records that exists in backend.- Returns:
- iterator consisting of all identifiers
- Throws:
- DataStoreException
 
 - 
existspublic boolean exists(DataIdentifier identifier, boolean touch) throws DataStoreException Description copied from interface:BackendThis method check the existence of record in backend. Return true if records exists else false. This method also touch record identified by identifier if touch is true.- Throws:
- DataStoreException
 
 - 
existspublic boolean exists(DataIdentifier identifier) throws DataStoreException Description copied from interface:BackendThis method check the existence of record in backend.- Parameters:
- identifier- identifier to be checked.
- Returns:
- true if records exists else false.
- Throws:
- DataStoreException
 
 - 
touchpublic void touch(DataIdentifier identifier, long minModifiedDate) throws DataStoreException Description copied from interface:BackendUpdate the lastModified of record if it's lastModified < minModifiedDate.- Throws:
- DataStoreException
 
 - 
touchAsyncpublic void touchAsync(DataIdentifier identifier, long minModifiedDate, AsyncTouchCallback callback) throws DataStoreException Description copied from interface:BackendUpdate the lastModified of record if it's lastModified < minModifiedDate asynchronously. Result of update is passed using appropriateAsyncTouchCallbackmethods. If identifier's lastModified > minModifiedAsyncTouchCallback.onAbort(AsyncTouchResult)is called. Any exception is communicated throughAsyncTouchCallback.onFailure(AsyncTouchResult). On successful update of lastModified,AsyncTouchCallback.onSuccess(AsyncTouchResult)is invoked.- Throws:
- DataStoreException
 
 - 
deleteAllOlderThanpublic Set<DataIdentifier> deleteAllOlderThan(long min) throws DataStoreException Description copied from interface:BackendDelete all records which are older than timestamp.- Returns:
- Setof identifiers which are deleted.
- Throws:
- DataStoreException
 
 - 
deleteRecordpublic void deleteRecord(DataIdentifier identifier) throws DataStoreException Description copied from interface:BackendDelete record identified by identifier. No-op if identifier not found.- Throws:
- DataStoreException
 
 - 
setPropertiespublic void setProperties(Properties properties) Properties used to configure the backend. If provided explicitly before init is invoked then these take precedence- Parameters:
- properties- to configure S3Backend
 
 
- 
 
-