public abstract class AbstractPreferenceStorage extends Object
Constructor and Description |
---|
AbstractPreferenceStorage() |
Modifier and Type | Method and Description |
---|---|
abstract String[] |
childrenNames(String nodePath)
Return a string array containing the names of the children for the node
with the given path.
|
abstract Properties |
load(String nodePath)
Return a
java.util.Properties object containing the preference
key/value pairs for the preference node with the specified path, and its children. |
protected Properties |
loadProperties(InputStream input)
Helper method to load a
java.util.Properties file from the given
input stream. |
abstract void |
removed(String nodePath)
Callback to inform the client that the preference node with the specified
path has been deleted and the client should react accordingly and make
the appropriate changes to the storage.
|
abstract void |
save(String nodePath,
Properties properties)
Save the given
java.util.Properties object which represents
preference key/value pairs for the preference node represented by the given
path. |
protected void |
saveProperties(OutputStream output,
Properties properties)
Helper method to save the given
java.util.Properties object
to the given output stream. |
public abstract Properties load(String nodePath) throws org.osgi.service.prefs.BackingStoreException
java.util.Properties
object containing the preference
key/value pairs for the preference node with the specified path, and its children.
The table keys consist of an optional child node path and separator, followed by the property key. The table values are the values of the properties.
[childNodePath/]propertyKey=propertyValue
Note: Whether they are absolute or relative, the paths in the returned Properties object are always interpreted as relative to the node specified by nodePath.
nodePath
- the absolute path of the preference nodejava.util.Properties
object or null
org.osgi.service.prefs.BackingStoreException
- if there was a problem loading the propertiespublic abstract void save(String nodePath, Properties properties) throws org.osgi.service.prefs.BackingStoreException
java.util.Properties
object which represents
preference key/value pairs for the preference node represented by the given
path.
Clients are reminded that if the given properties object is empty then the preference node has been removed and they should react accordingly (e.g. for instance by removing the file on disk)
nodePath
- the absolute path of the preference nodeproperties
- the java.util.Properties
object to storeorg.osgi.service.prefs.BackingStoreException
- if there was a problem saving the propertiesprotected Properties loadProperties(InputStream input) throws org.osgi.service.prefs.BackingStoreException
java.util.Properties
file from the given
input stream. The stream will be closed on completion of the operation.input
- the stream to load fromjava.util.Properties
object loaded from the streamorg.osgi.service.prefs.BackingStoreException
- if there was a problem loading the fileprotected void saveProperties(OutputStream output, Properties properties) throws org.osgi.service.prefs.BackingStoreException
java.util.Properties
object
to the given output stream. The stream will be closed at the end of the operation.output
- the stream to store the object toproperties
- the object to storeorg.osgi.service.prefs.BackingStoreException
- if there was a problem saving the objectpublic abstract String[] childrenNames(String nodePath) throws org.osgi.service.prefs.BackingStoreException
nodePath
- the path for the preference nodeorg.osgi.service.prefs.BackingStoreException
- if there was a problem retrieving the child namespublic abstract void removed(String nodePath)
nodePath
- the absolute path of the preference node
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.