|
Eclipse Remote Application Platform | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.rap.rwt.service.FileSettingStore
public final class FileSettingStore
A setting store implementation that persists all settings on the file system using Java
Properties files.
| Field Summary | |
|---|---|
static java.lang.String |
FILE_SETTING_STORE_DIR
This key (value "org.eclipse.rap.rwt.service.FileSettingStore.dir") can be used to configure the working directory for file settings stores. |
| Constructor Summary | |
|---|---|
FileSettingStore(java.io.File baseDirectory)
Creates an empty instance with a random unique ID. |
|
| Method Summary | |
|---|---|
void |
addSettingStoreListener(SettingStoreListener listener)
Attaches the given listener to this setting store. |
java.lang.String |
getAttribute(java.lang.String name)
Returns the attribute stored under the specified name in this setting store. |
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Returns an Enumeration of strings with the names of all attributes in this setting
store. |
java.lang.String |
getId()
Returns the unique identifier of this setting store. |
void |
loadById(java.lang.String id)
Replaces the contents of this setting store with the persisted contents associated with the given ID. |
void |
removeAttribute(java.lang.String name)
Removes the attribute stored under the specified name from this setting store. |
void |
removeSettingStoreListener(SettingStoreListener listener)
Removes the given listener from this setting store. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Stores a given attribute in this setting store, using the name specified. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FILE_SETTING_STORE_DIR
FileSettingStoreFactory.
| Constructor Detail |
|---|
public FileSettingStore(java.io.File baseDirectory)
loadById(String) to initialize
an existing store with previously persisted attributes.
baseDirectory - an existing directory to persist this store's settings in
java.lang.IllegalArgumentException - if the given workDir is not a directoryloadById(String)| Method Detail |
|---|
public java.lang.String getId()
SettingStore
getId in interface ISettingStoregetId in interface SettingStorenullpublic java.lang.String getAttribute(java.lang.String name)
SettingStore
getAttribute in interface ISettingStoregetAttribute in interface SettingStorename - a non-null String specifying the name of the attribute
null if no attribute is
stored under that name
public void setAttribute(java.lang.String name,
java.lang.String value)
throws java.io.IOException
SettingStore
If the value is null, this has the same effect as calling
SettingStore.removeAttribute(String).
SettingStoreListeners attached to this instance will be notified after an attribute has
been stored.
setAttribute in interface ISettingStoresetAttribute in interface SettingStorename - the name of the attribute, must not be null or emptyvalue - the attribute to store, may be null
java.io.IOException - if the load operation failed to complete normallypublic java.util.Enumeration<java.lang.String> getAttributeNames()
SettingStoreEnumeration of strings with the names of all attributes in this setting
store.
getAttributeNames in interface ISettingStoregetAttributeNames in interface SettingStorenull
public void loadById(java.lang.String id)
throws java.io.IOException
SettingStore
The attributes of this setting store will remain associated with the old id, but will be
removed from this store instance. SettingStoreListeners attached to this store
will receive a notification for each removed attribute.
During the load operation this store will be filled with the attributes associated with the new
ID. SettingStoreListeners attached to this store will receive a notification for each
added attribute.
After the load operation this store will only hold attributes associated with the new id value.
loadById in interface ISettingStoreloadById in interface SettingStoreid - the ID of the settings to load, must not be null or empty
java.io.IOException - if the load operation failed to complete normally
public void removeAttribute(java.lang.String name)
throws java.io.IOException
SettingStore
SettingStoreListeners attached to this instance will be notified after an attribute has
been removed.
removeAttribute in interface ISettingStoreremoveAttribute in interface SettingStorename - the name of the attribute to remove, must not be null
java.io.IOException - if the remove operation failed to complete normallypublic void addSettingStoreListener(SettingStoreListener listener)
SettingStore
addSettingStoreListener in interface ISettingStoreaddSettingStoreListener in interface SettingStorelistener - the listener to add, must not be nullpublic void removeSettingStoreListener(SettingStoreListener listener)
SettingStore
removeSettingStoreListener in interface ISettingStoreremoveSettingStoreListener in interface SettingStorelistener - the listener to remove, must not be null
|
Eclipse Remote Application Platform | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright (c) EclipseSource and others 2002, 2013. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0