Class ProjectFileStore
java.lang.Object
com.pnfsoftware.jeb.core.dao.impl.ProjectFileStore
- All Implemented Interfaces:
IFileDatabase
Simple
IFileDatabase implementation delegating blob storage operations to an
IFileStore.-
Constructor Summary
ConstructorsConstructorDescriptionProjectFileStore(IFileStore fstore) Create a project database delegating entry storage to a file store. -
Method Summary
Modifier and TypeMethodDescriptionbooleandeleteFile(String key) Delete a file.getDatabaseReader(String key) Get a database record reader.getDatabaseWriter(String key) Get a database record writer.getFileObject(String key) Attempt to get the filesystem object backing this db file entry.getFileReader(String key) Get an input stream reader for low-level reading from a file.getFileWriter(String key) Get an output stream reader for low-level writing to a file.booleanDetermine if the database contains the given file (the file must exist).byte[]Retrieve the contents of a file.booleanStore the contents of a file.
-
Constructor Details
-
ProjectFileStore
Create a project database delegating entry storage to a file store.- Parameters:
fstore- backing file store
-
-
Method Details
-
hasFile
Description copied from interface:IFileDatabaseDetermine if the database contains the given file (the file must exist).- Specified by:
hasFilein interfaceIFileDatabase- Parameters:
key- file key- Returns:
- presence indicator
-
saveFile
Description copied from interface:IFileDatabaseStore the contents of a file.- Specified by:
saveFilein interfaceIFileDatabase- Parameters:
key- file keydata- file data- Returns:
- success indicator
-
loadFile
Description copied from interface:IFileDatabaseRetrieve the contents of a file.- Specified by:
loadFilein interfaceIFileDatabase- Parameters:
key- file key- Returns:
- file data, null on error
-
deleteFile
Description copied from interface:IFileDatabaseDelete a file.- Specified by:
deleteFilein interfaceIFileDatabase- Parameters:
key- file key- Returns:
- success indicator
-
getFileObject
Description copied from interface:IFileDatabaseAttempt to get the filesystem object backing this db file entry.This method may not be implemented (e.g. if this database is not backed by on-disk files), in which case the implementation may throw an
UnsupportedOperationException.- Specified by:
getFileObjectin interfaceIFileDatabase- Parameters:
key- file key- Returns:
- the backing file object for the entry
-
getFileWriter
Description copied from interface:IFileDatabaseGet an output stream reader for low-level writing to a file. The client is responsible for closing the stream after usage.This method may not be implemented, in which case the implementation may throw an
UnsupportedOperationException.- Specified by:
getFileWriterin interfaceIFileDatabase- Parameters:
key- file key- Returns:
- an output stream writing to the entry contents
- Throws:
IOException- if the writer could not be created
-
getFileReader
Description copied from interface:IFileDatabaseGet an input stream reader for low-level reading from a file. The client is responsible for closing the stream after usage.This method may not be implemented, in which case the implementation may throw an
UnsupportedOperationException.- Specified by:
getFileReaderin interfaceIFileDatabase- Parameters:
key- file key- Returns:
- an input stream reading the entry contents
- Throws:
IOException- if the reader could not be created
-
getDatabaseWriter
Description copied from interface:IFileDatabaseGet a database record writer.This method may not be implemented, in which case the implementation may throw an
UnsupportedOperationException.- Specified by:
getDatabaseWriterin interfaceIFileDatabase- Parameters:
key- file key- Returns:
- a structured database writer for the entry
- Throws:
IOException- if the writer could not be created
-
getDatabaseReader
Description copied from interface:IFileDatabaseGet a database record reader.This method may not be implemented, in which case the implementation may throw an
UnsupportedOperationException.- Specified by:
getDatabaseReaderin interfaceIFileDatabase- Parameters:
key- file key- Returns:
- a structured database reader for the entry
- Throws:
IOException- if the reader could not be created
-