public class

MemoryFileStore

extends Object
implements IFileStore
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.dao.impl.MemoryFileStore

Class Overview

Implementation of a file-store where the record data is kept in memory.

Summary

Public Constructors
MemoryFileStore()
Public Methods
byte[] get(String key)
Retrieve the contents of a file from the store.
String getStoreLocation()
Get the store location.
boolean has(String key)
Verify if the given file is contained in the store.
List<String> list()
List all the files in this store.
String put(String key, byte[] data)
Store a new file in the store under the given key.
String put(byte[] data)
Store a new file in the store under a store-decided key.
boolean remove(String key)
Remove a file from the store.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.dao.IFileStore

Public Constructors

public MemoryFileStore ()

Public Methods

public byte[] get (String key)

Retrieve the contents of a file from the store.

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

public String getStoreLocation ()

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

Returns
  • the optional store location; may be null

public boolean has (String key)

Verify if the given file is contained in the store.

Parameters
key file key
Returns
  • presence indicator

public List<String> list ()

List all the files in this store.

Returns
  • a list of file keys

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

Remove a file from the store.

Parameters
key file key
Returns
  • success indicator