|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.petals.tools.webadmin.util.ServerPropertiesManager
public class ServerPropertiesManager
Manage a properties file.
Constructor Summary | |
---|---|
ServerPropertiesManager()
Creates a new instance of ServerPropertiesManager |
|
ServerPropertiesManager(java.lang.String rootPath)
Creates a new instance of ServerPropertiesManager with a path for
the file associated |
Method Summary | |
---|---|
void |
clear()
|
java.lang.String |
getAttributeValue(java.lang.String key)
Returns the value corresponding to the key in the properties as a String. |
java.util.Properties |
getProperties()
Returns all the properties |
java.lang.String |
getPropertiesFileName()
Gets the file name where properties are stored |
java.lang.String |
getRootPath()
|
boolean |
load()
Load properties from file. |
void |
save()
Save the actual properties into a file without comment |
void |
save(java.lang.String comments)
Save the actual properties into a file with a comment |
void |
setAttribute(java.lang.String key,
java.lang.String value)
Sets a new key/value property. |
void |
setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Copies all of the mappings from the specified Map to the properties attribute. |
void |
setProperties(java.util.Properties properties)
|
void |
setRootPath(java.lang.String rootPath)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerPropertiesManager()
ServerPropertiesManager
public ServerPropertiesManager(java.lang.String rootPath)
ServerPropertiesManager
with a path for
the file associated
Method Detail |
---|
public java.lang.String getPropertiesFileName()
public void clear()
public java.lang.String getAttributeValue(java.lang.String key)
key
- the key searched
public java.util.Properties getProperties()
public java.lang.String getRootPath()
public boolean load() throws java.io.IOException
java.io.IOException
public void save() throws java.io.IOException
java.io.IOException
public void save(java.lang.String comments) throws java.io.IOException
file
- the complete path to the file to write
java.io.IOException
public void setAttribute(java.lang.String key, java.lang.String value)
key
- the key of the propertyvalue
- the value correspondingpublic void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
properties
- a Map of the public void setProperties(java.util.Properties properties)
public final void setRootPath(java.lang.String rootPath)
rootPath
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |