Package pygar.documents
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
-
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 existsjava.io.InputStream
InputStoreStream(int sessionid, java.lang.String storeLocation, java.lang.String doctype)
Stream access to data in a data storestatic 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
-
Constructor Details
-
FileStore
public FileStore()
-
-
Method Details
-
InputStoreStream
public java.io.InputStream InputStoreStream(int sessionid, java.lang.String storeLocation, java.lang.String doctype) throws DocumentStoreNotFoundDescription copied from interface:Store
Stream access to data in a data store- Specified by:
InputStoreStream
in interfaceStore
- 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 DocumentStoreNotFoundDescription copied from interface:Store
A writer has access to data in a data store- Specified by:
OutputStoreStream
in interfaceStore
- 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 DocumentStoreNotFoundDescription copied from interface:Store
Determine if a data store already exists. If it does, clear the content; otherwise, do nothing.- Specified by:
clear
in interfaceStore
- 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 -
main
public static void main(java.lang.String[] args)- Parameters:
args
-
-