# Interface: com.pnfsoftware.jeb.core.dao.IFileDatabase

Database of binary blobs keyed by unique identifiers.  

  Typical implementations include [in\-memory or delegated stores](com.pnfsoftware.jeb.core.dao.impl.ProjectFileStore.md) and  [on\-disk JDB2 databases](com.pnfsoftware.jeb.core.dao.impl.JDB2Manager.md).

## Abstract Method: deleteFile
- parameter: `key`, type: `java.lang.String`
- return type: `boolean`

Description: Delete a file.
parameter: key: file key
return: success indicator

## Abstract Method: getDatabaseReader
- parameter: `key`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.dao.IFileDatabaseReader`
- throws: `java.io.IOException`

Description: Get a database record reader.  

  This method may not be implemented, in which case the implementation may throw an  [UnsupportedOperationException](java.lang.UnsupportedOperationException).
parameter: key: file key
return: a structured database reader for the entry
throws: if the reader could not be created

## Abstract Method: getDatabaseWriter
- parameter: `key`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.dao.IFileDatabaseWriter`
- throws: `java.io.IOException`

Description: Get a database record writer.  

  This method may not be implemented, in which case the implementation may throw an  [UnsupportedOperationException](java.lang.UnsupportedOperationException).
parameter: key: file key
return: a structured database writer for the entry
throws: if the writer could not be created

## Abstract 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](java.lang.UnsupportedOperationException).
parameter: key: file key
return: the backing file object for the entry

## Abstract Method: getFileReader
- parameter: `key`, type: `java.lang.String`
- return type: `java.io.InputStream`
- throws: `java.io.IOException`

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](java.lang.UnsupportedOperationException).
parameter: key: file key
return: an input stream reading the entry contents
throws: if the reader could not be created

## Abstract Method: getFileWriter
- parameter: `key`, type: `java.lang.String`
- return type: `java.io.OutputStream`
- throws: `java.io.IOException`

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](java.lang.UnsupportedOperationException).
parameter: key: file key
return: an output stream writing to the entry contents
throws: if the writer could not be created

## Abstract 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

## Abstract 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

## Abstract 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

