public abstract class AbstractFilesystemStore extends AbstractReadWriteStore
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
AbstractFilesystemStore.FSEnumeration |
| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
characterCaseDiff |
(package private) static java.util.BitSet |
charactersDontNeedingEncoding
A BitSet defining the characters which don't need encoding
|
protected java.io.File |
m_directoryFile
The directory repository
|
protected java.lang.String |
m_directoryPath |
lockPERSISTENT_STORE, ROLE, TRANSIENT_STORE| Constructor and Description |
|---|
AbstractFilesystemStore() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addKeys(AbstractFilesystemStore.FSEnumeration enumer,
java.io.File directory) |
protected int |
countKeys(java.io.File directory) |
protected java.lang.String |
decode(java.lang.String filename)
Inverse of encode exept it do not use path.
|
java.lang.Object |
deserializeObject(java.io.File file)
This method deserializes an object from an input stream.
|
java.lang.String |
deserializeString(java.io.File file)
Load a text file contents as a
String |
protected void |
doClear()
Clear the Store of all elements
|
protected boolean |
doContainsKey(java.lang.Object key)
Indicates if the given key is associated to a contained object.
|
protected void |
doFree()
Try to free some used memory.
|
protected java.lang.Object |
doGet(java.lang.Object key)
Get the File object associated with the given unique key name.
|
protected java.util.Enumeration |
doGetKeys()
Returns the list of stored files as an Enumeration of Files
|
protected int |
doGetSize()
Returns count of the objects in the store, or -1 if could not be
obtained.
|
protected void |
doRemove(java.lang.Object key)
Remove the object associated to the given key.
|
protected void |
doStore(java.lang.Object key,
java.lang.Object value)
Store the given object in a persistent state.
|
protected java.lang.String |
encode(java.lang.String s)
Returns a String that uniquely identifies the object.
|
protected java.io.File |
fileFromKey(java.lang.Object key) |
void |
free()
Frees some values of the data file.
|
java.lang.String |
getDirectoryPath()
Returns the repository's full pathname
|
java.lang.String |
getFullFilename(java.io.File file)
Get the complete filename corresponding to a (typically relative)
File. |
java.lang.Object |
getObject(java.lang.Object key) |
java.lang.String |
getString(java.lang.Object key) |
void |
serializeObject(java.io.File file,
java.lang.Object object)
This method serializes an object to an output stream.
|
void |
serializeString(java.io.File file,
java.lang.String string)
Dump a
String to a text file. |
void |
setDirectory(java.io.File directory)
Sets the repository's location
|
void |
setDirectory(java.lang.String directory)
Sets the repository's location
|
clear, containsKey, get, getChildInstrumentables, getInstrumentableName, getInstruments, keys, remove, setInstrumentableName, size, storeprotected java.io.File m_directoryFile
protected volatile java.lang.String m_directoryPath
static java.util.BitSet charactersDontNeedingEncoding
static final int characterCaseDiff
public void setDirectory(java.lang.String directory)
throws java.io.IOException
java.io.IOExceptionpublic void setDirectory(java.io.File directory)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getDirectoryPath()
protected java.lang.Object doGet(java.lang.Object key)
doGet in class AbstractReadWriteStoreprotected void doStore(java.lang.Object key,
java.lang.Object value)
throws java.io.IOException
doStore in class AbstractReadWriteStorejava.io.IOExceptionprotected void doRemove(java.lang.Object key)
doRemove in class AbstractReadWriteStoreprotected void doClear()
doClear in class AbstractReadWriteStoreprotected boolean doContainsKey(java.lang.Object key)
doContainsKey in class AbstractReadWriteStoreprotected java.util.Enumeration doGetKeys()
doGetKeys in class AbstractReadWriteStoreprotected int doGetSize()
doGetSize in class AbstractReadWriteStoreprotected void addKeys(AbstractFilesystemStore.FSEnumeration enumer, java.io.File directory)
protected int countKeys(java.io.File directory)
protected java.io.File fileFromKey(java.lang.Object key)
public java.lang.String getString(java.lang.Object key)
throws java.io.IOException
java.io.IOExceptionpublic void free()
AbstractReadWriteStorefree in interface Storefree in class AbstractReadWriteStoreprotected void doFree()
AbstractReadWriteStoredoFree in class AbstractReadWriteStorepublic java.lang.Object getObject(java.lang.Object key)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionprotected java.lang.String decode(java.lang.String filename)
protected java.lang.String encode(java.lang.String s)
public void serializeString(java.io.File file,
java.lang.String string)
throws java.io.IOException
String to a text file.file - The output filestring - The string to be dumpedjava.io.IOException - IO Errorpublic java.lang.String deserializeString(java.io.File file)
throws java.io.IOException
String.
This method does not perform enconding conversionsfile - The input fileStringjava.io.IOException - IO Errorpublic void serializeObject(java.io.File file,
java.lang.Object object)
throws java.io.IOException
file - The output fileobject - The object to be serializedjava.io.IOException - IOErrorpublic java.lang.Object deserializeObject(java.io.File file)
throws java.io.IOException,
java.lang.ClassNotFoundException
file - The input filejava.io.IOException - IOErrorjava.lang.ClassNotFoundExceptionpublic java.lang.String getFullFilename(java.io.File file)
File.
This method accounts for the possibility of an error in getting
the filename's canonical path, returning the io/error-safe
absolute form insteadfile - The file