|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.store.Store
|
+--webfunds.store.SepFileStore
A hashtable object that provides access to files stored in a directory. Every piece of data is stored in a separate file, hence, 'SepFile.'
| Field Summary | |
static int |
APPEND
|
protected java.lang.String |
badFiles
|
protected java.io.PrintWriter |
bug
|
protected java.io.File |
dir
|
protected boolean |
error
|
protected java.lang.String |
fix
|
static int |
NET
|
static int |
SOMETHING
|
protected java.util.Hashtable |
stores
|
protected boolean |
syncbool
|
static int |
VERSION
The version of the stored format for objects. |
| Fields inherited from class webfunds.store.Store |
APPEND,
changed,
error,
hash,
name,
NET,
SOMETHING |
| Constructor Summary | |
SepFileStore()
Open an empty, new SepFileStore with nothing set. |
|
SepFileStore(java.io.File dir)
Open an empty, new SepFileStore. |
|
SepFileStore(java.io.File dir,
java.io.PrintWriter pw,
java.lang.String logfix)
Open an empty, new SepFileStore with diags |
|
| Method Summary | |
protected static void |
checkDir(java.io.File dir)
|
boolean |
checkErrors()
|
void |
clear()
Removes all files in this directory, and any empty directories (intentional?). |
java.io.PrintWriter |
err()
Do stack trace prints to err(), should always return something. |
java.lang.Object |
get(java.lang.Object key)
Return a (file) object located in the hashtable. |
protected Store |
getAppendStore(java.lang.String name)
|
java.lang.String |
getBadFiles()
|
java.io.PrintWriter |
getDebug()
Returns a debug writer, if any is set. |
static Store |
getInstance(java.io.File dir)
|
static SepFileStore |
getInstance(java.io.File dir,
java.io.PrintWriter pw,
java.lang.String logfix)
Returns an existing SepFileStore, with files in dir read in as objects in the hashtable. |
protected Store |
getOldStore(java.lang.String name)
|
Store |
getStore(java.lang.String name,
java.lang.ClassLoader cl)
Open up a new subStore, with ClassLoader set. |
Store |
getStore(java.lang.String name,
int flags)
Open up a new subStore, with variations. |
Store[] |
getStores()
Within this current store, all directories are ignored by the creating getInstance() method. |
boolean |
getSync()
|
void |
init(java.io.File dir,
java.io.PrintWriter pw,
java.lang.String logfix)
Open an empty, new SepFileStore with diags |
protected void |
initFiles()
|
void |
logmsg(java.lang.String s)
|
static void |
main(java.lang.String[] args)
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
(Re)sets a (file) object into the hashtable. |
protected boolean |
readEncodedFile(java.io.File file)
|
protected void |
readFile(java.io.File file)
|
java.lang.Object |
remove(java.lang.Object key)
Drop the object from both hashtable and disk. |
void |
setSync(boolean syncbool)
Call with true if sync-to-disk is required for all puts. |
protected void |
sync()
Don't know. |
protected void |
sync(java.lang.String key)
Write and sync a file to disk. |
java.lang.String |
toString()
|
| Methods inherited from class webfunds.store.Store |
contains,
containsKey,
elements,
getClassLoader,
getName,
getStore,
getType,
isChanged,
isEmpty,
keys,
setChanged,
setClassLoader,
size |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int VERSION
protected java.io.File dir
protected boolean syncbool
protected boolean error
protected java.lang.String badFiles
protected java.util.Hashtable stores
protected java.io.PrintWriter bug
protected java.lang.String fix
public static final int APPEND
public static final int NET
public static final int SOMETHING
| Constructor Detail |
public SepFileStore()
public SepFileStore(java.io.File dir)
public SepFileStore(java.io.File dir,
java.io.PrintWriter pw,
java.lang.String logfix)
| Method Detail |
public java.lang.String getBadFiles()
public void logmsg(java.lang.String s)
public java.io.PrintWriter getDebug()
public java.io.PrintWriter err()
public void init(java.io.File dir,
java.io.PrintWriter pw,
java.lang.String logfix)
public static Store getInstance(java.io.File dir)
public static SepFileStore getInstance(java.io.File dir,
java.io.PrintWriter pw,
java.lang.String logfix)
protected static void checkDir(java.io.File dir)
protected void initFiles()
protected void readFile(java.io.File file)
protected boolean readEncodedFile(java.io.File file)
public void setSync(boolean syncbool)
public boolean getSync()
protected Store getOldStore(java.lang.String name)
public Store getStore(java.lang.String name,
int flags)
throws StoreException
protected Store getAppendStore(java.lang.String name)
throws StoreException
public Store getStore(java.lang.String name,
java.lang.ClassLoader cl)
throws StoreException
public Store[] getStores()
throws StoreException
public boolean checkErrors()
public void clear()
public java.lang.Object get(java.lang.Object key)
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
public java.lang.Object remove(java.lang.Object key)
protected void sync()
protected void sync(java.lang.String key)
public java.lang.String toString()
public static void main(java.lang.String[] args)
throws java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||