Class FileStore

java.lang.Object
pygar.documents.FileStore
All Implemented Interfaces:
Store

@NotThreadSafe
public class FileStore
extends java.lang.Object
implements Store
This implements document storage through the file system. The thread safety of this class depends entirely on the thread safety of the file operations that are called from the operating system. You should assume the class is not thread safe and use it from a dedicated thread.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface pygar.documents.Store

    Store.StoreType
  • Constructor Summary

    Constructors 
    Constructor Description
    FileStore()  
  • Method Summary

    Modifier and Type Method Description
    void clear​(int sessionid, java.lang.String storeLocation, java.lang.String doctype)
    Determine if a data store already exists.
    boolean exists​(int sessionid, java.lang.String storeLocation, java.lang.String doctype)
    Determine if a data store already exists
    java.io.InputStream InputStoreStream​(int sessionid, java.lang.String storeLocation, java.lang.String doctype)
    Stream access to data in a data store
    static void main​(java.lang.String[] args)  
    java.io.OutputStream OutputStoreStream​(int sessionid, java.lang.String storeLocation, java.lang.String doctype)
    A writer has access to data in a data store

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • InputStoreStream

      public java.io.InputStream InputStoreStream​(int sessionid, java.lang.String storeLocation, java.lang.String doctype) throws DocumentStoreNotFound
      Description copied from interface: Store
      Stream access to data in a data store
      Specified by:
      InputStoreStream in interface Store
      Parameters:
      sessionid - The identity number of the session to which the data document belongs.
      storeLocation - A string identifying where the storage should be located.
      Returns:
      An object conforming to the Reader interface in java.io
      Throws:
      DocumentStoreNotFound
    • OutputStoreStream

      public java.io.OutputStream OutputStoreStream​(int sessionid, java.lang.String storeLocation, java.lang.String doctype) throws DocumentStoreNotFound
      Description copied from interface: Store
      A writer has access to data in a data store
      Specified by:
      OutputStoreStream in interface Store
      Parameters:
      sessionid - The identity number of the session to which the data document belongs.
      storeLocation - A string identifying where the storage should be located.
      Returns:
      An object conforming to the Reader interface in java.io
      Throws:
      DocumentStoreNotFound
    • clear

      public void clear​(int sessionid, java.lang.String storeLocation, java.lang.String doctype) throws DocumentStoreNotFound
      Description copied from interface: Store
      Determine if a data store already exists. If it does, clear the content; otherwise, do nothing.
      Specified by:
      clear in interface Store
      Parameters:
      sessionid - The identity number of the session to which the data document belongs.
      storeLocation - A string identifying where the storage should be located.
      Throws:
      DocumentStoreNotFound
    • exists

      public boolean exists​(int sessionid, java.lang.String storeLocation, java.lang.String doctype)
      Description copied from interface: Store
      Determine if a data store already exists
      Specified by:
      exists in interface Store
      Parameters:
      sessionid - The identity number of the session to which the data document belongs.
      storeLocation - A string identifying where the storage should be located.
      Returns:
      true if the Store object exists and false otherwise.
    • main

      public static void main​(java.lang.String[] args)
      Parameters:
      args -