public interface

IFileStore

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

Class Overview

Definition of a binary file store: a store where artifacts are byte arrays uniquely identified by a key.

Summary

Public Methods
abstract byte[] get(String key)
Retrieve the contents of a file from the store.
abstract String getStoreLocation()
Get the store location.
abstract boolean has(String key)
Verify if the given file is contained in the store.
abstract List<String> list()
List all the files in this store.
abstract String put(String key, byte[] data)
Store a new file in the store under the given key.
abstract String put(byte[] data)
Store a new file in the store under a store-decided key.
abstract boolean remove(String key)
Remove a file from the store.

Public Methods

public abstract byte[] get (String key)

Retrieve the contents of a file from the store.

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

public abstract String getStoreLocation ()

Get the store location. Example: a root folder, a base url.

Returns
  • the optional store location; may be null

public abstract boolean has (String key)

Verify if the given file is contained in the store.

Parameters
key file key
Returns
  • presence indicator

public abstract List<String> list ()

List all the files in this store.

Returns
  • a list of file keys

public abstract String put (String key, byte[] data)

Store a new file in the store under the given key.

Parameters
key file key, null to let the implementor create a new key
data file data
Returns
  • the file key, null on error

public abstract String put (byte[] data)

Store a new file in the store under a store-decided key.

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

public abstract boolean remove (String key)

Remove a file from the store.

Parameters
key file key
Returns
  • success indicator