public class FilePreferences
extends java.util.prefs.AbstractPreferences
| Modifier and Type | Class and Description |
|---|---|
static class |
FilePreferences.Factory
PreferencesFactory implementation that stores the preferences in an XML file.
|
protected static class |
FilePreferences.RootNode |
| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<java.lang.String> |
childNames |
private static java.lang.String[] |
EMPTY_NAME_ARRAY |
private static java.util.logging.Logger |
log |
private boolean |
modified |
private java.util.Map<java.lang.String,java.lang.String> |
prefs |
protected FilePreferences.RootNode |
root |
| Modifier | Constructor and Description |
|---|---|
protected |
FilePreferences(java.util.prefs.AbstractPreferences parent,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String[] |
childrenNamesSpi() |
protected FilePreferences |
childSpi(java.lang.String name) |
static FilePreferences |
createRoot() |
static FilePreferences |
createRoot(java.lang.String preferencesFilePath) |
void |
flush() |
protected void |
flushSpi() |
java.io.File |
getPreferencesFile() |
FilePreferences |
getRoot() |
protected java.lang.String |
getSpi(java.lang.String key) |
boolean |
isModified() |
protected java.lang.String[] |
keysSpi() |
java.lang.String |
nodePrefix()
Returns the absolute path and ensures that it ends with a slash (/)
For child nodes this is the same as
absolutePath() + '/' but for
the root node it is just '/'. |
protected void |
putSpi(java.lang.String key,
java.lang.String value) |
protected void |
readProps() |
protected void |
removeNodeSpi() |
protected void |
removeSpi(java.lang.String key) |
protected FilePreferences.RootNode |
rootNode() |
void |
setPreferencesFile(java.io.File file) |
void |
sync() |
protected void |
syncSpi() |
absolutePath, addNodeChangeListener, addPreferenceChangeListener, cachedChildren, childrenNames, clear, exportNode, exportSubtree, get, getBoolean, getByteArray, getChild, getDouble, getFloat, getInt, getLong, isRemoved, isUserNode, keys, name, node, nodeExists, parent, put, putBoolean, putByteArray, putDouble, putFloat, putInt, putLong, remove, removeNode, removeNodeChangeListener, removePreferenceChangeListener, toStringprivate java.util.Set<java.lang.String> childNames
private static final java.lang.String[] EMPTY_NAME_ARRAY
private static final java.util.logging.Logger log
private boolean modified
private java.util.Map<java.lang.String,java.lang.String> prefs
protected final FilePreferences.RootNode root
protected FilePreferences(java.util.prefs.AbstractPreferences parent,
java.lang.String name)
protected java.lang.String[] childrenNamesSpi()
throws java.util.prefs.BackingStoreException
childrenNamesSpi in class java.util.prefs.AbstractPreferencesjava.util.prefs.BackingStoreExceptionprotected FilePreferences childSpi(java.lang.String name)
childSpi in class java.util.prefs.AbstractPreferencespublic static FilePreferences createRoot()
public static FilePreferences createRoot(java.lang.String preferencesFilePath)
public void flush()
throws java.util.prefs.BackingStoreException
flush in class java.util.prefs.AbstractPreferencesjava.util.prefs.BackingStoreExceptionprotected void flushSpi()
throws java.util.prefs.BackingStoreException
flushSpi in class java.util.prefs.AbstractPreferencesjava.util.prefs.BackingStoreExceptionpublic java.io.File getPreferencesFile()
public FilePreferences getRoot()
protected java.lang.String getSpi(java.lang.String key)
getSpi in class java.util.prefs.AbstractPreferencespublic boolean isModified()
protected java.lang.String[] keysSpi()
throws java.util.prefs.BackingStoreException
keysSpi in class java.util.prefs.AbstractPreferencesjava.util.prefs.BackingStoreExceptionpublic java.lang.String nodePrefix()
absolutePath() + '/' but for
the root node it is just '/'.protected void putSpi(java.lang.String key,
java.lang.String value)
putSpi in class java.util.prefs.AbstractPreferencesprotected void readProps()
protected void removeNodeSpi()
throws java.util.prefs.BackingStoreException
removeNodeSpi in class java.util.prefs.AbstractPreferencesjava.util.prefs.BackingStoreExceptionprotected void removeSpi(java.lang.String key)
removeSpi in class java.util.prefs.AbstractPreferencesprotected FilePreferences.RootNode rootNode()
public void setPreferencesFile(java.io.File file)
public void sync()
throws java.util.prefs.BackingStoreException
sync in class java.util.prefs.AbstractPreferencesjava.util.prefs.BackingStoreExceptionprotected void syncSpi()
throws java.util.prefs.BackingStoreException
syncSpi in class java.util.prefs.AbstractPreferencesjava.util.prefs.BackingStoreException