Class FileConfigStorage
- java.lang.Object
-
- org.jfree.report.modules.preferences.filesystem.FileConfigStorage
-
- All Implemented Interfaces:
ConfigStorage
public class FileConfigStorage extends java.lang.Object implements ConfigStorage
The FileConfigStorage is a storage provider that stores its content on the local filesystem. The directory used contains the data as plain text property files.- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description FileConfigStorage(java.io.File baseDirectory)Creates a new file config storage and stores the contents in the given directory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisAvailable(java.lang.String configPath)Tests, whether some configuration data exists for the given configuration.org.pentaho.reporting.libraries.base.config.Configurationload(java.lang.String configPath, org.pentaho.reporting.libraries.base.config.Configuration defaults)Loads the properties from the given path, specifying the given properties as default.voidstore(java.lang.String configPath, org.pentaho.reporting.libraries.base.config.Configuration config)Stores the given properties on the defined path.java.lang.StringtoString()
-
-
-
Method Detail
-
store
public void store(java.lang.String configPath, org.pentaho.reporting.libraries.base.config.Configuration config) throws ConfigStoreExceptionStores the given properties on the defined path. This implementation stores the data as property files.- Specified by:
storein interfaceConfigStorage- Parameters:
configPath- the configuration path that specifies where to store the properties.config- the properties which should be stored.- Throws:
ConfigStoreException- if an error occured.
-
load
public org.pentaho.reporting.libraries.base.config.Configuration load(java.lang.String configPath, org.pentaho.reporting.libraries.base.config.Configuration defaults) throws ConfigStoreExceptionLoads the properties from the given path, specifying the given properties as default.- Specified by:
loadin interfaceConfigStorage- Parameters:
configPath- the configuration path from where to load the properties.defaults- the property set that acts as fallback to provide default values.- Returns:
- the loaded properties.
- Throws:
ConfigStoreException- if an error occured.
-
isAvailable
public boolean isAvailable(java.lang.String configPath)
Tests, whether some configuration data exists for the given configuration.- Specified by:
isAvailablein interfaceConfigStorage- Parameters:
configPath- the configuration path to the property storage.- Returns:
- true, if there are properties under this path, false otherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-