| java.lang.Object henplus.io.ConfigurationContainer
ConfigurationContainer | final public class ConfigurationContainer (Code) | | Helper class to write the configuration. Focus is to avoid half-written configuration
files if IO-Errors occur (full harddisk ..) and to merge properties.
author: hzeller version: $Revision: 1.1 $ |
Inner Class :public interface ReadAction | |
Inner Class :public interface WriteAction | |
Method Summary | |
public void | read(ReadAction action) Execute the read action with the InputStream from the corresponding
configuration file. | public Map | readProperties() | public Map | readProperties(Map prefill) convenience-method to read properties. | public void | storeProperties(Map props, boolean allowMerge, String comment) convenience-method to write properties. | public void | write(WriteAction action) Write configuration. |
ConfigurationContainer | public ConfigurationContainer(File file)(Code) | | |
read | public void read(ReadAction action)(Code) | | Execute the read action with the InputStream from the corresponding
configuration file.
|
readProperties | public Map readProperties()(Code) | | |
readProperties | public Map readProperties(Map prefill)(Code) | | convenience-method to read properties. If you handle
simple properties within your command, then use
this method so that versioning and merging
is handled.
|
storeProperties | public void storeProperties(Map props, boolean allowMerge, String comment)(Code) | | convenience-method to write properties. Properties
must have been read before.
Parameters: allowMerge - allow merging of properties that havebeen added by another instance of henplus. |
write | public void write(WriteAction action)(Code) | | Write configuration. The configuration is first written to a temporary
file. Does not overwrite the original file if any Exception
occurs in the course of this or the resulting file is no different.
|
|
|