public class

ProjectFileStore

extends Object
implements IFileDatabase
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.dao.impl.ProjectFileStore

Class Overview

A project store backed by the file system.

Summary

Public Constructors
ProjectFileStore(IFileStore fstore)
Public Methods
boolean deleteFile(String key)
Delete a file.
IFileDatabaseReader getDatabaseReader(String key)
Get a database record reader.
IFileDatabaseWriter getDatabaseWriter(String key)
Get a database record writer.
File getFileObject(String key)
Attempt to get the filesystem object backing this db file entry.
InputStream getFileReader(String key)
Get an input stream reader for low-level reading from a file.
OutputStream getFileWriter(String key)
Get an output stream reader for low-level writing to a file.
boolean hasFile(String key)
Determine if the database contains the given file (the file must exist).
byte[] loadFile(String key)
Retrieve the contents of a file.
boolean saveFile(String key, byte[] data)
Store the contents of a file.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.dao.IFileDatabase

Public Constructors

public ProjectFileStore (IFileStore fstore)

Public Methods

public boolean deleteFile (String key)

Delete a file.

Parameters
key file key
Returns
  • success indicator

public 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 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 File getFileObject (String key)

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.

public 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 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 boolean hasFile (String key)

Determine if the database contains the given file (the file must exist).

Parameters
key file key
Returns
  • presence indicator

public byte[] loadFile (String key)

Retrieve the contents of a file.

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

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

Store the contents of a file.

Parameters
key file key
data file data
Returns
  • success indicator