|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.rad.server.config.UpToDateConfigFile
public class UpToDateConfigFile
The UpToDateConfigFile encapsulates the access to a xml configuration
file. It's guaranteed that the access to the properties of the file is up-to-date.
That means that changes will be detected automatically.
| Constructor Summary | |
|---|---|
UpToDateConfigFile(File pConfig)
Creates a new instance of UpToDateConfigFile for a
xml configuration file. |
|
UpToDateConfigFile(File pConfig,
boolean pLazyLoading)
Creates a new instance of UpToDateConfigFile for a
xml configuration file. |
|
UpToDateConfigFile(File pDirectory,
String pConfig)
Creates a new instance of UpToDateConfigFile for a
xml configuration file. |
|
UpToDateConfigFile(File pDirectory,
String pConfig,
boolean pLazyLoading)
Creates a new instance of UpToDateConfigFile for a
xml configuration file. |
|
| Method Summary | |
|---|---|
protected XmlNode |
getContent()
Gets the current configuration xml content. |
File |
getFile()
Gets the configuration file. |
List<XmlNode> |
getNodes(String pName)
Gets the value for a property as xml representation. |
List<String> |
getProperties(String pName)
Gets a list of values for a property which exists more than once. |
String |
getProperty(String pName)
Gets the value of a property from the application configuration file. |
String |
getProperty(String pName,
String pDefault)
Gets the value of a property from the application configuration file. |
boolean |
isValid()
Checks if the configuration file exists. |
protected void |
setContent(XmlNode pConfig)
Sets the current configuration xml content. |
protected void |
update()
Loads the configuration from the filesystem. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UpToDateConfigFile(File pDirectory,
String pConfig)
throws Exception
UpToDateConfigFile for a
xml configuration file. The configuration will read immediately.
pDirectory - the directory where to find the configuration filepConfig - the configuration file name
Exception - if it is not possible to read the configuration
from the filesystem or the xml content is not valid
public UpToDateConfigFile(File pDirectory,
String pConfig,
boolean pLazyLoading)
throws Exception
UpToDateConfigFile for a
xml configuration file.
pDirectory - the directory where to find the configuration filepConfig - the configuration file namepLazyLoading - true to load the configuration immediate,
false to load the configuration when used the first time
Exception - if it is not possible to read the configuration
from the filesystem or the xml content is not valid
public UpToDateConfigFile(File pConfig)
throws Exception
UpToDateConfigFile for a
xml configuration file. The configuration will read immediately.
pConfig - the configuration file
Exception - if it is not possible to read the configuration
from the filesystem or the xml content is not valid
public UpToDateConfigFile(File pConfig,
boolean pLazyLoading)
throws Exception
UpToDateConfigFile for a
xml configuration file.
pConfig - the configuration filepLazyLoading - true to load the configuration immediate,
false to load the configuration when used the first time
Exception - if it is not possible to read the configuration
from the filesystem or the xml content is not valid| Method Detail |
|---|
public File getFile()
protected XmlNode getContent()
throws Exception
XmlNode
Exception - if the configuration is invalid or it's not possible to create a clone
of the contentprotected void setContent(XmlNode pConfig)
pConfig - the XmlNode for the contentpublic boolean isValid()
true if the configuration file exists otherwise false
protected void update()
throws Exception
Exception - if it is not possible to read the configuration
from the filesystem or the xml content is not valid
public String getProperty(String pName)
throws Exception
pName - the property name (e.g /application/securitymanager/class)
Exception - if the configuration is invalid
public String getProperty(String pName,
String pDefault)
throws Exception
pName - the property name (e.g /application/securitymanager/class)pDefault - the default value if the property is not available
pDefault if the property is not available
Exception - if the configuration is invalid
public List<String> getProperties(String pName)
throws Exception
pName - the property name
null if the property is not available
Exception - if the configuration is invalid
public List<XmlNode> getNodes(String pName)
throws Exception
pName - the property name
null if the property is not available
Exception - if the configuration is invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||