Class DefaultPreferences

java.lang.Object
java.util.prefs.Preferences
org.tentackle.prefs.DefaultPreferences
All Implemented Interfaces:
PersistedPreferences

public class DefaultPreferences extends Preferences implements PersistedPreferences
Wraps a java util preferences node into a PersistedPreferences node.
See Also:
  • Field Summary

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a preferences node.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns this preference node's absolute path name.
    void
    Registers the specified listener to receive node change events for this node.
    void
    Registers the specified listener to receive preference change events for this preference node.
    Returns the names of the children of this preference node, relative to this node.
    void
    Removes all the preferences (key-value associations) in this preference node.
    protected String
    Converts the given pathname if absolute.
    For pathname starting with a slash the optional name of the root node will be prepended.
    void
     
    void
     
    void
    Forces any changes in the contents of this preference node and its descendants to the persistent store.
    get(String key, String def)
    Returns the value associated with the specified key in this preference node.
    boolean
    getBoolean(String key, boolean def)
    Returns the boolean value represented by the string associated with the specified key in this preference node.
    byte[]
    getByteArray(String key, byte[] def)
    Returns the byte array value represented by the string associated with the specified key in this preference node.
    double
    getDouble(String key, double def)
    Returns the double value represented by the string associated with the specified key in this preference node.
    float
    getFloat(String key, float def)
    Returns the float value represented by the string associated with the specified key in this preference node.
    int
    getInt(String key, int def)
    Returns the int value represented by the string associated with the specified key in this preference node.
    long
    getLong(String key, long def)
    Returns the long value represented by the string associated with the specified key in this preference node.
    boolean
    Returns true if this preference node is in the user preference tree, false if it's in the system preference tree.
    Returns all the keys that have an associated value in this preference node.
    Returns this preference node's name, relative to its parent.
    node(String pathName)
    Returns the named preference node in the same tree as this node, creating it and any of its ancestors if they do not already exist.
    boolean
    nodeExists(String pathName)
    Returns true if the named preference node exists in the same tree as this node.
    Returns the parent of this preference node, or null if this is the root.
    void
    put(String key, String value)
    Associates the specified value with the specified key in this preference node.
    void
    putBoolean(String key, boolean value)
    Associates a string representing the specified boolean value with the specified key in this preference node.
    void
    putByteArray(String key, byte[] value)
    Associates a string representing the specified byte array with the specified key in this preference node.
    void
    putDouble(String key, double value)
    Associates a string representing the specified double value with the specified key in this preference node.
    void
    putFloat(String key, float value)
    Associates a string representing the specified float value with the specified key in this preference node.
    void
    putInt(String key, int value)
    Associates a string representing the specified int value with the specified key in this preference node.
    void
    putLong(String key, long value)
    Associates a string representing the specified long value with the specified key in this preference node.
    void
    Removes the value associated with the specified key in this preference node, if any.
    void
    Removes this preference node and all of its descendants, invalidating any preferences contained in the removed nodes.
    void
    Removes the specified NodeChangeListener, so it no longer receives change events.
    void
    Removes the specified preference change listener, so it no longer receives preference change events.
    void
    Ensures that future reads from this preference node and its descendants reflect any changes that were committed to the persistent store (from any VM) prior to the sync invocation.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DefaultPreferences

      public DefaultPreferences(Preferences preferences)
      Creates a preferences node.
      Parameters:
      preferences - the java util preferences node to wrap
  • Method Details

    • put

      public void put(String key, String value)
      Description copied from interface: PersistedPreferences
      Associates the specified value with the specified key in this preference node.

      Specified by:
      put in interface PersistedPreferences
      Specified by:
      put in class Preferences
      Parameters:
      key - key with which the specified value is to be associated.
      value - value to be associated with the specified key.

    • get

      public String get(String key, String def)
      Description copied from interface: PersistedPreferences
      Returns the value associated with the specified key in this preference node. Returns the specified default if there is no value associated with the key, or the backing store is inaccessible.

      Some implementations may store default values in their backing stores. If there is no value associated with the specified key but there is such a stored default, it is returned in preference to the specified default.

      Specified by:
      get in interface PersistedPreferences
      Specified by:
      get in class Preferences
      Parameters:
      key - key whose associated value is to be returned.
      def - the value to be returned in the event that this preference node has no value associated with key.

      Returns:
      the value associated with key, or def if no value is associated with key, or the backing store is inaccessible.

    • remove

      public void remove(String key)
      Description copied from interface: PersistedPreferences
      Removes the value associated with the specified key in this preference node, if any.

      If this implementation supports stored defaults, and there is such a default for the specified preference, the stored default will be "exposed" by this call, in the sense that it will be returned by a succeeding call to get.

      Specified by:
      remove in interface PersistedPreferences
      Specified by:
      remove in class Preferences
      Parameters:
      key - key whose mapping is to be removed from the preference node.

    • clear

      public void clear() throws BackingStoreException
      Description copied from interface: PersistedPreferences
      Removes all the preferences (key-value associations) in this preference node. This call has no effect on any descendants of this node.

      If this implementation supports stored defaults, and this node in the preference hierarchy contains any such defaults, the stored defaults will be "exposed" by this call, in the sense that they will be returned by succeeding calls to get.

      Specified by:
      clear in interface PersistedPreferences
      Specified by:
      clear in class Preferences
      Throws:
      BackingStoreException - if this operation cannot be completed due to failure in the backing store, or inability to communicate with it.
      See Also:
    • putInt

      public void putInt(String key, int value)
      Description copied from interface: PersistedPreferences
      Associates a string representing the specified int value with the specified key in this preference node. The associated string is the one that would be returned if the int value were passed to Integer.toString(int). This method is intended for use in conjunction with PersistedPreferences.getInt(String, int).

      Specified by:
      putInt in interface PersistedPreferences
      Specified by:
      putInt in class Preferences
      Parameters:
      key - key with which the string form of value is to be associated.
      value - value whose string form is to be associated with the key.

      See Also:
    • getInt

      public int getInt(String key, int def)
      Description copied from interface: PersistedPreferences
      Returns the int value represented by the string associated with the specified key in this preference node. The string is converted to an integer as by Integer.parseInt(String). Returns the specified default if there is no value associated with the key, the backing store is inaccessible, or if Integer.parseInt(String) would throw a NumberFormatException if the associated value were passed. This method is intended for use in conjunction with PersistedPreferences.putInt(String, int).

      If the implementation supports stored defaults and such a default exists, is accessible, and could be converted to an int with Integer.parseInt, this int is returned in preference to the specified default.

      Specified by:
      getInt in interface PersistedPreferences
      Specified by:
      getInt in class Preferences
      Parameters:
      key - key whose associated value is to be returned as an int.
      def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as an int, or the backing store is inaccessible.

      Returns:
      the int value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as an int.

      See Also:
    • putLong

      public void putLong(String key, long value)
      Description copied from interface: PersistedPreferences
      Associates a string representing the specified long value with the specified key in this preference node. The associated string is the one that would be returned if the long value were passed to Long.toString(long). This method is intended for use in conjunction with PersistedPreferences.getLong(String, long).

      Specified by:
      putLong in interface PersistedPreferences
      Specified by:
      putLong in class Preferences
      Parameters:
      key - key with which the string form of value is to be associated.
      value - value whose string form is to be associated with the key.

      See Also:
    • getLong

      public long getLong(String key, long def)
      Description copied from interface: PersistedPreferences
      Returns the long value represented by the string associated with the specified key in this preference node. The string is converted to a long as by Long.parseLong(String). Returns the specified default if there is no value associated with the key, the backing store is inaccessible, or if Long.parseLong(String) would throw a NumberFormatException if the associated value were passed. This method is intended for use in conjunction with PersistedPreferences.putLong(String, long).

      If the implementation supports stored defaults and such a default exists, is accessible, and could be converted to a long with Long.parseLong, this long is returned in preference to the specified default.

      Specified by:
      getLong in interface PersistedPreferences
      Specified by:
      getLong in class Preferences
      Parameters:
      key - key whose associated value is to be returned as a long value.
      def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a long value, or the backing store is inaccessible.

      Returns:
      the long value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as a long value.

      See Also:
    • putBoolean

      public void putBoolean(String key, boolean value)
      Description copied from interface: PersistedPreferences
      Associates a string representing the specified boolean value with the specified key in this preference node. The associated string is "true" if the value is true, and "false" if it is false. This method is intended for use in conjunction with PersistedPreferences.getBoolean(String, boolean).

      Specified by:
      putBoolean in interface PersistedPreferences
      Specified by:
      putBoolean in class Preferences
      Parameters:
      key - key with which the string form of value is to be associated.
      value - value whose string form is to be associated with the key.

      See Also:
    • getBoolean

      public boolean getBoolean(String key, boolean def)
      Description copied from interface: PersistedPreferences
      Returns the boolean value represented by the string associated with the specified key in this preference node. Valid strings are "true", which represents true, and "false", which represents false. Case is ignored, so, for example, "TRUE" and "False" are also valid. This method is intended for use in conjunction with PersistedPreferences.putBoolean(String, boolean).

      Returns the specified default if there is no value associated with the key, the backing store is inaccessible, or if the associated value is something other than "true" or "false", ignoring the case.

      If the implementation supports stored defaults and such a default exists and is accessible, it is used in preference to the specified default, unless the stored default is something other than "true" or "false", ignoring the case, in which case the specified default is used.

      Specified by:
      getBoolean in interface PersistedPreferences
      Specified by:
      getBoolean in class Preferences
      Parameters:
      key - key whose associated value is to be returned as a boolean.
      def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a boolean, or the backing store is inaccessible.

      Returns:
      the boolean value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as a boolean.

      See Also:
    • putFloat

      public void putFloat(String key, float value)
      Description copied from interface: PersistedPreferences
      Associates a string representing the specified float value with the specified key in this preference node. The associated string is the one that would be returned if the float value were passed to Float.toString(float). This method is intended for use in conjunction with PersistedPreferences.getFloat(String, float).

      Specified by:
      putFloat in interface PersistedPreferences
      Specified by:
      putFloat in class Preferences
      Parameters:
      key - key with which the string form of value is to be associated.
      value - value whose string form is to be associated with the key.

      See Also:
    • getFloat

      public float getFloat(String key, float def)
      Description copied from interface: PersistedPreferences
      Returns the float value represented by the string associated with the specified key in this preference node. The string is converted to an integer as by Float.parseFloat(String). Returns the specified default if there is no value associated with the key, the backing store is inaccessible, or if Float.parseFloat(String) would throw a NumberFormatException if the associated value were passed. This method is intended for use in conjunction with PersistedPreferences.putFloat(String, float).

      If the implementation supports stored defaults and such a default exists, is accessible, and could be converted to a float with Float.parseFloat, this float is returned in preference to the specified default.

      Specified by:
      getFloat in interface PersistedPreferences
      Specified by:
      getFloat in class Preferences
      Parameters:
      key - key whose associated value is to be returned as a float.
      def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a float, or the backing store is inaccessible.

      Returns:
      the float value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as a float.

      See Also:
    • putDouble

      public void putDouble(String key, double value)
      Description copied from interface: PersistedPreferences
      Associates a string representing the specified double value with the specified key in this preference node. The associated string is the one that would be returned if the double value were passed to Double.toString(double). This method is intended for use in conjunction with PersistedPreferences.getDouble(String, double).

      Specified by:
      putDouble in interface PersistedPreferences
      Specified by:
      putDouble in class Preferences
      Parameters:
      key - key with which the string form of value is to be associated.
      value - value whose string form is to be associated with the key.

      See Also:
    • getDouble

      public double getDouble(String key, double def)
      Description copied from interface: PersistedPreferences
      Returns the double value represented by the string associated with the specified key in this preference node. The string is converted to an integer as by Double.parseDouble(String). Returns the specified default if there is no value associated with the key, the backing store is inaccessible, or if Double.parseDouble(String) would throw a NumberFormatException if the associated value were passed. This method is intended for use in conjunction with PersistedPreferences.putDouble(String, double).

      If the implementation supports stored defaults and such a default exists, is accessible, and could be converted to a double with Double.parseDouble, this double is returned in preference to the specified default.

      Specified by:
      getDouble in interface PersistedPreferences
      Specified by:
      getDouble in class Preferences
      Parameters:
      key - key whose associated value is to be returned as a double.
      def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a double, or the backing store is inaccessible.

      Returns:
      the double value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as a double.

      See Also:
    • putByteArray

      public void putByteArray(String key, byte[] value)
      Description copied from interface: PersistedPreferences
      Associates a string representing the specified byte array with the specified key in this preference node. The associated string is the Base64 encoding of the byte array, as defined in RFC 2045, Section 6.8, with one minor change: the string will consist solely of characters from the Base64 Alphabet; it will not contain any newline characters. Note that the maximum length of the byte array is limited to three quarters of MAX_VALUE_LENGTH so that the length of the Base64 encoded String does not exceed MAX_VALUE_LENGTH. This method is intended for use in conjunction with PersistedPreferences.getByteArray(String, byte[]).

      Specified by:
      putByteArray in interface PersistedPreferences
      Specified by:
      putByteArray in class Preferences
      Parameters:
      key - key with which the string form of value is to be associated.
      value - value whose string form is to be associated with the key.

      See Also:
    • getByteArray

      public byte[] getByteArray(String key, byte[] def)
      Description copied from interface: PersistedPreferences
      Returns the byte array value represented by the string associated with the specified key in this preference node. Valid strings are Base64 encoded binary data, as defined in RFC 2045, Section 6.8, with one minor change: the string must consist solely of characters from the Base64 Alphabet; no newline characters or extraneous characters are permitted. This method is intended for use in conjunction with PersistedPreferences.putByteArray(String, byte[]).

      Returns the specified default if there is no value associated with the key, the backing store is inaccessible, or if the associated value is not a valid Base64 encoded byte array (as defined above).

      If the implementation supports stored defaults and such a default exists and is accessible, it is used in preference to the specified default, unless the stored default is not a valid Base64 encoded byte array (as defined above), in which case the specified default is used.

      Specified by:
      getByteArray in interface PersistedPreferences
      Specified by:
      getByteArray in class Preferences
      Parameters:
      key - key whose associated value is to be returned as a byte array.
      def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a byte array, or the backing store is inaccessible.

      Returns:
      the byte array value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as a byte array.

      See Also:
    • keys

      public String[] keys() throws BackingStoreException
      Description copied from interface: PersistedPreferences
      Returns all the keys that have an associated value in this preference node. (The returned array will be of size zero if this node has no preferences.)

      If the implementation supports stored defaults and there are any such defaults at this node that have not been overridden, by explicit preferences, the defaults are returned in the array in addition to any explicit preferences.

      Specified by:
      keys in interface PersistedPreferences
      Specified by:
      keys in class Preferences
      Returns:
      an array of the keys that have an associated value in this preference node.

      Throws:
      BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
    • childrenNames

      public String[] childrenNames() throws BackingStoreException
      Description copied from interface: PersistedPreferences
      Returns the names of the children of this preference node, relative to this node. (The returned array will be of size zero if this node has no children.)

      Specified by:
      childrenNames in interface PersistedPreferences
      Specified by:
      childrenNames in class Preferences
      Returns:
      the names of the children of this preference node.

      Throws:
      BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
    • parent

      public DefaultPreferences parent()
      Description copied from interface: PersistedPreferences
      Returns the parent of this preference node, or null if this is the root.

      Specified by:
      parent in interface PersistedPreferences
      Specified by:
      parent in class Preferences
      Returns:
      the parent of this preference node.

    • node

      public DefaultPreferences node(String pathName)
      Description copied from interface: PersistedPreferences
      Returns the named preference node in the same tree as this node, creating it and any of its ancestors if they do not already exist. Accepts a relative or absolute path name. Relative path names (which do not begin with the slash character ('/')) are interpreted relative to this preference node.

      If the returned node did not exist prior to this call, this node and any ancestors that were created by this call are not guaranteed to become permanent until the flush method is called on the returned node (or one of its ancestors or descendants).

      Specified by:
      node in interface PersistedPreferences
      Specified by:
      node in class Preferences
      Parameters:
      pathName - the path name of the preference node to return.

      Returns:
      the specified preference node.

      See Also:
    • nodeExists

      public boolean nodeExists(String pathName) throws BackingStoreException
      Description copied from interface: PersistedPreferences
      Returns true if the named preference node exists in the same tree as this node. Relative path names (which do not begin with the slash character ('/')) are interpreted relative to this preference node.

      If this node (or an ancestor) has already been removed with the PersistedPreferences.removeNode() method, it is legal to invoke this method, but only with the path name ""; the invocation will return false. Thus, the idiom p.nodeExists("") may be used to test whether p has been removed.

      Specified by:
      nodeExists in interface PersistedPreferences
      Specified by:
      nodeExists in class Preferences
      Parameters:
      pathName - the path name of the node whose existence is to be checked.

      Returns:
      true if the specified node exists.

      Throws:
      BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
    • removeNode

      public void removeNode() throws BackingStoreException
      Description copied from interface: PersistedPreferences
      Removes this preference node and all of its descendants, invalidating any preferences contained in the removed nodes. Once a node has been removed, attempting any method other than PersistedPreferences.name(), PersistedPreferences.absolutePath(), PersistedPreferences.isUserNode(), PersistedPreferences.flush() or nodeExists("") on the corresponding Preferences instance will fail with an IllegalStateException. (The methods defined on Object can still be invoked on a node after it has been removed; they will not throw IllegalStateException.)

      The removal is not guaranteed to be persistent until the flush method is called on this node (or an ancestor).

      If this implementation supports stored defaults, removing a node exposes any stored defaults at or below this node. Thus, a subsequent call to nodeExists on this node's path name may return true, and a subsequent call to node on this path name may return a (different) Preferences instance representing a non-empty collection of preferences and/or children.

      Specified by:
      removeNode in interface PersistedPreferences
      Specified by:
      removeNode in class Preferences
      Throws:
      BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
      See Also:
    • name

      public String name()
      Description copied from interface: PersistedPreferences
      Returns this preference node's name, relative to its parent.

      Specified by:
      name in interface PersistedPreferences
      Specified by:
      name in class Preferences
      Returns:
      this preference node's name, relative to its parent.
    • absolutePath

      public String absolutePath()
      Description copied from interface: PersistedPreferences
      Returns this preference node's absolute path name.

      Specified by:
      absolutePath in interface PersistedPreferences
      Specified by:
      absolutePath in class Preferences
      Returns:
      this preference node's absolute path name.
    • isUserNode

      public boolean isUserNode()
      Description copied from interface: PersistedPreferences
      Returns true if this preference node is in the user preference tree, false if it's in the system preference tree.

      Specified by:
      isUserNode in interface PersistedPreferences
      Specified by:
      isUserNode in class Preferences
      Returns:
      true if this preference node is in the user preference tree, false if it's in the system preference tree.
    • toString

      public String toString()
      Specified by:
      toString in class Preferences
    • flush

      public void flush() throws BackingStoreException
      Description copied from interface: PersistedPreferences
      Forces any changes in the contents of this preference node and its descendants to the persistent store. Once this method returns successfully, it is safe to assume that all changes made in the subtree rooted at this node prior to the method invocation have become permanent.

      Implementations are free to flush changes into the persistent store at any time. They do not need to wait for this method to be called.

      When a flush occurs on a newly created node, it is made persistent, as are any ancestors (and descendants) that have yet to be made persistent. Please notice that any preference value changes in ancestors are not guaranteed to be made persistent.

      If this method is invoked on a node that has been removed with the PersistedPreferences.removeNode() method, flushSpi() is invoked on this node, but not on others.

      Specified by:
      flush in interface PersistedPreferences
      Specified by:
      flush in class Preferences
      Throws:
      BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
      See Also:
    • sync

      public void sync() throws BackingStoreException
      Description copied from interface: PersistedPreferences
      Ensures that future reads from this preference node and its descendants reflect any changes that were committed to the persistent store (from any VM) prior to the sync invocation. As a side effect, forces any changes in the contents of this preference node and its descendants to the persistent store, as if the flush method had been invoked on this node.

      Specified by:
      sync in interface PersistedPreferences
      Specified by:
      sync in class Preferences
      Throws:
      BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
      See Also:
    • addPreferenceChangeListener

      public void addPreferenceChangeListener(PreferenceChangeListener pcl)
      Description copied from interface: PersistedPreferences
      Registers the specified listener to receive preference change events for this preference node. A preference change event is generated when a preference is added to this node, removed from this node, or when the value associated with a preference is changed. (Preference change events are not generated by the PersistedPreferences.removeNode() method, which generates a node change event. Preference change events are generated by the clear method.)

      Events are only guaranteed for changes made within the same JVM as the registered listener, though some implementations may generate events for changes made outside this JVM. Events may be generated before the changes have been made persistent. Events are not generated when preferences are modified in descendants of this node; a caller desiring such events must register with each descendant.

      Specified by:
      addPreferenceChangeListener in interface PersistedPreferences
      Specified by:
      addPreferenceChangeListener in class Preferences
      Parameters:
      pcl - The preference change listener to add.

      See Also:
    • removePreferenceChangeListener

      public void removePreferenceChangeListener(PreferenceChangeListener pcl)
      Description copied from interface: PersistedPreferences
      Removes the specified preference change listener, so it no longer receives preference change events.

      Specified by:
      removePreferenceChangeListener in interface PersistedPreferences
      Specified by:
      removePreferenceChangeListener in class Preferences
      Parameters:
      pcl - The preference change listener to remove.

      See Also:
    • addNodeChangeListener

      public void addNodeChangeListener(NodeChangeListener ncl)
      Description copied from interface: PersistedPreferences
      Registers the specified listener to receive node change events for this node. A node change event is generated when a child node is added to or removed from this node. (A single PersistedPreferences.removeNode() invocation results in multiple node change events, one for every node in the subtree rooted at the removed node.)

      Events are only guaranteed for changes made within the same JVM as the registered listener, though some implementations may generate events for changes made outside this JVM. Events may be generated before the changes have become permanent. Events are not generated when indirect descendants of this node are added or removed; a caller desiring such events must register with each descendant.

      Few guarantees can be made regarding node creation. Because nodes are created implicitly upon access, it may not be feasible for an implementation to determine whether a child node existed in the backing store prior to access (for example, because the backing store is unreachable or cached information is out of date). Under these circumstances, implementations are neither required to generate node change events nor prohibited from doing so.

      Specified by:
      addNodeChangeListener in interface PersistedPreferences
      Specified by:
      addNodeChangeListener in class Preferences
      Parameters:
      ncl - The NodeChangeListener to add.

      See Also:
    • removeNodeChangeListener

      public void removeNodeChangeListener(NodeChangeListener ncl)
      Description copied from interface: PersistedPreferences
      Removes the specified NodeChangeListener, so it no longer receives change events.

      Specified by:
      removeNodeChangeListener in interface PersistedPreferences
      Specified by:
      removeNodeChangeListener in class Preferences
      Parameters:
      ncl - The NodeChangeListener to remove.

      See Also:
    • exportNode

      public void exportNode(OutputStream os) throws IOException, BackingStoreException
      Specified by:
      exportNode in class Preferences
      Throws:
      IOException
      BackingStoreException
    • exportSubtree

      public void exportSubtree(OutputStream os) throws IOException, BackingStoreException
      Specified by:
      exportSubtree in class Preferences
      Throws:
      IOException
      BackingStoreException
    • convertPathName

      protected String convertPathName(String pathName)
      Converts the given pathname if absolute.
      For pathname starting with a slash the optional name of the root node will be prepended. By default, the name of the root node is the empty string, but applications may override DefaultPreferencesFactory.userRoot() and/or DefaultPreferencesFactory.systemRoot() to create an extra storage subfolder for the application.
      Parameters:
      pathName - the original pathname
      Returns:
      the possibly converted pathname