|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--edu.iu.iv.common.boot.ConfigFile
A simple config file reader. The format for the config files it reads is the following: Comments are started with either "//", "#", or "[". The last one is used for demarking sections (for example "[IVCInitializer Properties]"). Each property being assigned is formatted as follows: Property = Value. Note that currently if a config file is read in then written out, the comments are not guaranteed to be saved.
| Field Summary | |
static java.lang.String |
ERROR_LOG_FILE
|
static java.lang.String |
LIB_DIRECTORY
|
static java.lang.String |
PLUGIN_DIRECTORY
|
static java.lang.String |
USER_LOG_FILE
|
| Constructor Summary | |
ConfigFile(java.io.File configFile)
create a new config file object with the configFile being read in and parsed for any data it may have. |
|
| Method Summary | |
java.util.prefs.Preferences |
getPreferences()
Gets the backing java.util.prefs.Preferences node |
java.lang.String |
getValue(java.lang.String property)
get the associated value for the property. |
void |
setProperty(java.lang.String property,
java.lang.String value)
Sets a property for the configuration. |
void |
writeConfigFile()
Writes out the config file |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String LIB_DIRECTORY
public static final java.lang.String PLUGIN_DIRECTORY
public static final java.lang.String ERROR_LOG_FILE
public static final java.lang.String USER_LOG_FILE
| Constructor Detail |
public ConfigFile(java.io.File configFile)
throws java.io.IOException
configFile - the config file to use. it does not have to be currently created.
java.io.IOException - if there is any IO problems while reading the file an exception will be thrown.| Method Detail |
public java.lang.String getValue(java.lang.String property)
property - the property to get its value from.
public void setProperty(java.lang.String property,
java.lang.String value)
property - the propertyvalue - the property's associated value.public java.util.prefs.Preferences getPreferences()
public void writeConfigFile()
throws java.io.IOException
java.io.IOException - if a file error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||