public class FileSystemConfigurationContext extends Object implements ConfigurationContext
ConfigurationContext
.Constructor and Description |
---|
FileSystemConfigurationContext(File rootDir)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
ConfigurationItem |
createConfigurationItem(String location,
InputStream configuration)
Creates a new
ConfigurationItem at the relative location. |
void |
deleteConfigurationItem(String relativeLocation)
Deletes the
ConfigurationItem at the relative location. |
ConfigurationItem |
getConfigurationItem(String location)
Obtains the
ConfigurationItem at the relative location. |
String |
getLocation()
Obtains the location for this
ConfigurationContext . |
boolean |
isReadOnly()
Indicates if the configuration is read-only.
|
public FileSystemConfigurationContext(File rootDir) throws IOException
rootDir
- Root directory for files containing the configuration.IOException
- If fails to initiate.public String getLocation()
ConfigurationContext
Obtains the location for this ConfigurationContext
.
This value is used in the equality of ConfigurationContext
instances.
getLocation
in interface ConfigurationContext
ConfigurationContext
.public ConfigurationItem getConfigurationItem(String location) throws Exception
ConfigurationContext
ConfigurationItem
at the relative location.getConfigurationItem
in interface ConfigurationContext
location
- Relative location of the ConfigurationItem
to obtain.ConfigurationItem
.Exception
- If can not obtain a ConfigurationItem
at the relative
location.public boolean isReadOnly()
ConfigurationContext
isReadOnly
in interface ConfigurationContext
true
should the configuration be read-only.public ConfigurationItem createConfigurationItem(String location, InputStream configuration) throws Exception
ConfigurationContext
ConfigurationItem
at the relative location.createConfigurationItem
in interface ConfigurationContext
location
- Relative location of the ConfigurationItem
to create.configuration
- Configuration for the ConfigurationItem
.ConfigurationItem
.Exception
- If fails to create the ConfigurationItem
.ReadOnlyConfigurationException
- Should the underlying implementation be read-only.public void deleteConfigurationItem(String relativeLocation) throws Exception, ReadOnlyConfigurationException
ConfigurationContext
ConfigurationItem
at the relative location.deleteConfigurationItem
in interface ConfigurationContext
relativeLocation
- Relative location of the ConfigurationItem
to delete.Exception
- If can not delete the ConfigurationItem
at the
relative location.ReadOnlyConfigurationException
- Should the underlying implementation be read-only.Copyright © 2005–2016. All rights reserved.