# Interface: com.pnfsoftware.jeb.core.dao.IFileDatabase

Database of binary blobs keyed by unique identifiers. 

 Typical implementations include [in\-memory or delegated stores](ProjectFileStore) and [on\-disk JDB2 databases](JDB2Manager).

## Method: deleteFile
- parameter: `key`, type: `java.lang.String`
- return type: `boolean`

Description: Delete a file.
parameter: key: file key
return: success indicator

## Method: getDatabaseReader
- parameter: `key`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.dao.IFileDatabaseReader`

Description: Get a database record reader. 

 This method may not be implemented, in which case the implementation may throw an [UnsupportedOperationException](UnsupportedOperationException).
parameter: key: file key
return: a structured database reader for the entry
throws: if the reader could not be created

## Method: getDatabaseWriter
- parameter: `key`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.dao.IFileDatabaseWriter`

Description: Get a database record writer. 

 This method may not be implemented, in which case the implementation may throw an [UnsupportedOperationException](UnsupportedOperationException).
parameter: key: file key
return: a structured database writer for the entry
throws: if the writer could not be created

## Method: getFileObject
- parameter: `key`, type: `java.lang.String`
- return type: `java.io.File`

Description: 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](UnsupportedOperationException).
parameter: key: file key
return: the backing file object for the entry

## Method: getFileReader
- parameter: `key`, type: `java.lang.String`
- return type: `java.io.InputStream`

Description: 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](UnsupportedOperationException).
parameter: key: file key
return: an input stream reading the entry contents
throws: if the reader could not be created

## Method: getFileWriter
- parameter: `key`, type: `java.lang.String`
- return type: `java.io.OutputStream`

Description: 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](UnsupportedOperationException).
parameter: key: file key
return: an output stream writing to the entry contents
throws: if the writer could not be created

## Method: hasFile
- parameter: `key`, type: `java.lang.String`
- return type: `boolean`

Description: Determine if the database contains the given file \(the file must exist\).
parameter: key: file key
return: presence indicator

## Method: loadFile
- parameter: `key`, type: `java.lang.String`
- return type: `byte[]`

Description: Retrieve the contents of a file.
parameter: key: file key
return: file data, null on error

## Method: saveFile
- parameter: `key`, type: `java.lang.String`
- parameter: `data`, type: `byte[]`
- return type: `boolean`

Description: Store the contents of a file.
parameter: key: file key
parameter: data: file data
return: success indicator

