Class ProjectFileStore
java.lang.Object
com.pnfsoftware.jeb.core.dao.impl.ProjectFileStore
- All Implemented Interfaces:
IFileDatabase
A project store backed by the file system.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
deleteFile
(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.boolean
Determine if the database contains the given file (the file must exist).byte[]
Retrieve the contents of a file.boolean
Store the contents of a file.
-
Constructor Details
-
ProjectFileStore
-
-
Method Details
-
hasFile
Description copied from interface:IFileDatabase
Determine if the database contains the given file (the file must exist).- Specified by:
hasFile
in interfaceIFileDatabase
- Parameters:
key
- file key- Returns:
- presence indicator
-
saveFile
Description copied from interface:IFileDatabase
Store the contents of a file.- Specified by:
saveFile
in interfaceIFileDatabase
- Parameters:
key
- file keydata
- file data- Returns:
- success indicator
-
loadFile
Description copied from interface:IFileDatabase
Retrieve the contents of a file.- Specified by:
loadFile
in interfaceIFileDatabase
- Parameters:
key
- file key- Returns:
- file data, null on error
-
deleteFile
Description copied from interface:IFileDatabase
Delete a file.- Specified by:
deleteFile
in interfaceIFileDatabase
- Parameters:
key
- file key- Returns:
- success indicator
-
getFileObject
Description copied from interface:IFileDatabase
Attempt 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:
getFileObject
in interfaceIFileDatabase
- Returns:
-
getFileWriter
Description copied from interface:IFileDatabase
Get 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:
getFileWriter
in interfaceIFileDatabase
- Returns:
- Throws:
IOException
-
getFileReader
Description copied from interface:IFileDatabase
Get 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:
getFileReader
in interfaceIFileDatabase
- Returns:
- Throws:
IOException
-
getDatabaseWriter
Description copied from interface:IFileDatabase
Get a database record writer.This method may not be implemented, in which case the implementation may throw an
UnsupportedOperationException
.- Specified by:
getDatabaseWriter
in interfaceIFileDatabase
- Returns:
- Throws:
IOException
-
getDatabaseReader
Description copied from interface:IFileDatabase
Get a database record reader.This method may not be implemented, in which case the implementation may throw an
UnsupportedOperationException
.- Specified by:
getDatabaseReader
in interfaceIFileDatabase
- Returns:
- Throws:
IOException
-