| |
|
| java.lang.Object com.lutris.util.FilePersistentStore
FilePersistentStore | public class FilePersistentStore implements PersistentStore(Code) | | File system implementation of PersistentStore.
author: Kyle Clark |
Constructor Summary | |
public | FilePersistentStore() Public constructor. | public | FilePersistentStore(ClassLoader loader) Public constructor. | public | FilePersistentStore(String storeDirectory) Public constructor that allows one to specify
the directory (repository)
where objects are stored/retrieved.
If the specified directory doesn't exist then it is created.
Parameters: storeDirectory - The repository (directory) for storing and retrieving objects. exception: java.io.IOException - If storeDirectory already exists but is not a directory. | public | FilePersistentStore(String storeDirectory, ClassLoader loader) Public constructor that allows one to specify
the directory (repository)
where objects are stored/retrieved.
If the specified directory doesn't exist then it is created.
Parameters: storeDirectory - The repository (directory) for storing and retrieving objects. exception: java.io.IOException - If storeDirectory already exists but is not a directory. |
Method Summary | |
public void | delete(String key) Method to delete a a key. | public boolean | exists(String key) Method to query if an an object is stored. | public String | getStoreDirectory() Returns the location where objects are
stored/retrieved. | public java.util.Enumeration | keys() Method that returns an enumration of the keys
of this persistent store. | public Object | remove(String key) Method to simultaneously retrieve and remove an
object from persistent store. | public Object | retrieve(String key) Method to retrieve a stored object.
Parameters: key - The key of the object that is to be retreived.The stored object. | public void | store(String key, Serializable obj) Method to store and object (persistent).
Parameters: key - The key by which to identify the stored object.The key name has some system constraints. |
FilePersistentStore | public FilePersistentStore() throws PersistentStoreException(Code) | | Public constructor. Sets the storeDirectory ,
the directory (repository) where objects
are stored/retreived to /tmp .
exception: java.io.IOException - If /tmp already exists but is not a directory. Or if /tmp does not exist and couldnot be created. exception: java.lang.SecurityException - If a securitymanager is running but /tmp could not be created due to inappropriatepermissions. |
FilePersistentStore | public FilePersistentStore(ClassLoader loader) throws IOException, SecurityException, PersistentStoreException(Code) | | Public constructor. Sets the storeDirectory ,
the directory (repository) where objects
are stored/retreived to /tmp .
Parameters: loader - the class loader to use when readingin serialized data. exception: java.io.IOException - If /tmp already exists but is not a directory. Or if /tmp does not exist and couldnot be created. exception: java.lang.SecurityException - If a securitymanager is running but /tmp could not be created due to inappropriatepermissions. |
FilePersistentStore | public FilePersistentStore(String storeDirectory) throws PersistentStoreException(Code) | | Public constructor that allows one to specify
the directory (repository)
where objects are stored/retrieved.
If the specified directory doesn't exist then it is created.
Parameters: storeDirectory - The repository (directory) for storing and retrieving objects. exception: java.io.IOException - If storeDirectory already exists but is not a directory. Or if thestoreDirectory does not exist and couldnot be created. exception: java.lang.SecurityException - If a securitymanager is running but storeDirectory could not be created due to inappropriatepermissions. |
FilePersistentStore | public FilePersistentStore(String storeDirectory, ClassLoader loader) throws PersistentStoreException(Code) | | Public constructor that allows one to specify
the directory (repository)
where objects are stored/retrieved.
If the specified directory doesn't exist then it is created.
Parameters: storeDirectory - The repository (directory) for storing and retrieving objects. exception: java.io.IOException - If storeDirectory already exists but is not a directory. Or if thestoreDirectory does not exist and couldnot be created. exception: java.lang.SecurityException - If a securitymanager is running but storeDirectory could not be created due to inappropriatepermissions. |
delete | public void delete(String key)(Code) | | Method to delete a a key. Any objects stored under
key are also removed. If key is not defined, then
this method does nothing.
Parameters: key - The key to remove. |
exists | public boolean exists(String key) throws PersistentStoreException(Code) | | Method to query if an an object is stored.
Parameters: key - The key by which to identify the stored object.True if an object is stored under key. exception: PersistentStoreException - If The exsitence of object could not be determined. |
getStoreDirectory | public String getStoreDirectory()(Code) | | Returns the location where objects are
stored/retrieved.
The directory (repository) where objects are stored/retrieved. |
remove | public Object remove(String key) throws PersistentStoreException(Code) | | Method to simultaneously retrieve and remove an
object from persistent store. If an object is not
stored under key, then null is returned.
Parameters: key - The key by which to identify the stored objectthat is to be removed.The object that has been removed. exception: PersistentStoreException - If the object could not be retrieved before being deleted. |
store | public void store(String key, Serializable obj) throws PersistentStoreException(Code) | | Method to store and object (persistent).
Parameters: key - The key by which to identify the stored object.The key name has some system constraints. Its lengthmust not exceed half the maximum file name length onthe system. If it does, an exception is thrown. Parameters: obj - The serializable object to store. exception: PersistentStoreException - if the object cannot cannot be stored. |
|
|
|