Class SimpleFSFileStore

java.lang.Object
com.pnfsoftware.jeb.core.dao.impl.SimpleFSFileStore
All Implemented Interfaces:
IFileStore

public class SimpleFSFileStore extends Object implements IFileStore
Implementation of a file-store where the record data is kept on the file system.
  • Constructor Details

    • SimpleFSFileStore

      public SimpleFSFileStore(String basedir)
  • Method Details

    • getStoreLocation

      public String getStoreLocation()
      Description copied from interface: IFileStore
      Get the store location. Example: a root folder, a base url.
      Specified by:
      getStoreLocation in interface IFileStore
      Returns:
      the optional store location; may be null
    • has

      public boolean has(String key)
      Description copied from interface: IFileStore
      Verify if the given file is contained in the store.
      Specified by:
      has in interface IFileStore
      Parameters:
      key - file key
      Returns:
      presence indicator
    • remove

      public boolean remove(String key)
      Description copied from interface: IFileStore
      Remove a file from the store.
      Specified by:
      remove in interface IFileStore
      Parameters:
      key - file key
      Returns:
      success indicator
    • get

      public byte[] get(String key)
      Description copied from interface: IFileStore
      Retrieve the contents of a file from the store.
      Specified by:
      get in interface IFileStore
      Parameters:
      key - file key
      Returns:
      file data, null on error
    • put

      public String put(byte[] data)
      Description copied from interface: IFileStore
      Store a new file in the store under a store-decided key.
      Specified by:
      put in interface IFileStore
      Parameters:
      data - file data
      Returns:
      the file key, null on error
    • put

      public String put(String key, byte[] data)
      Description copied from interface: IFileStore
      Store a new file in the store under the given key.
      Specified by:
      put in interface IFileStore
      Parameters:
      key - file key, null to let the implementor create a new key
      data - file data
      Returns:
      the file key, null on error
    • list

      public List<String> list()
      Description copied from interface: IFileStore
      List all the files in this store.
      Specified by:
      list in interface IFileStore
      Returns:
      a list of file keys