public interface

IFileDatabase

com.pnfsoftware.jeb.core.dao.IFileDatabase
Known Indirect Subclasses

Class Overview

Definition of a database of versioned binary files. Each entry is identified by a unique key and a version number.

Summary

Public Methods
abstract boolean deleteFile(String key, int version)
Delete a file.
abstract IFileDatabaseReader getDatabaseReader(String key)
Get a database record reader.
abstract IFileDatabaseWriter getDatabaseWriter(String key)
Get a database record writer.
abstract InputStream getFileReader(String key)
Get an input stream reader for low-level reading from a file.
abstract OutputStream getFileWriter(String key)
Get an output stream reader for low-level writing to a file.
abstract boolean hasFile(String key, int version)
Determine if the database contains the given file.
abstract byte[] loadFile(String key, int version)
Retrieve the contents of a file.
abstract boolean saveFile(String key, int version, byte[] data)
Store the contents of a file.

Public Methods

public abstract boolean deleteFile (String key, int version)

Delete a file.

Parameters
key file key
version file version
Returns
  • success indicator

public abstract IFileDatabaseReader getDatabaseReader (String key)

Get a database record reader.

This method may not be implemented, in which case the implementation may throw an UnsupportedOperationException.@return

Throws
IOException

public abstract IFileDatabaseWriter getDatabaseWriter (String key)

Get a database record writer.

This method may not be implemented, in which case the implementation may throw an UnsupportedOperationException.@return

Throws
IOException

public abstract InputStream getFileReader (String key)

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.@return

Throws
IOException

public abstract OutputStream getFileWriter (String key)

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.@return

Throws
IOException

public abstract boolean hasFile (String key, int version)

Determine if the database contains the given file.

Parameters
key file key
version file version
Returns
  • presence indicator

public abstract byte[] loadFile (String key, int version)

Retrieve the contents of a file.

Parameters
key file key
version file version
Returns
  • file data, null on error

public abstract boolean saveFile (String key, int version, byte[] data)

Store the contents of a file.

Parameters
key file key
version file version
data file data
Returns
  • success indicator