de.adom.jade.utils
Class ConfigurationFile

java.lang.Object
  extended by de.adom.jade.utils.ConfigurationFile

public class ConfigurationFile
extends java.lang.Object

Manages a configuration file contained in the distributed software. The file handles entries of the form entryName parameter1 parameter2 .... Lines starting with a # represent comments and are ignored. Empty lines are likewise ignored. Leading and trailing spaces also are ignored.


Constructor Summary
ConfigurationFile(java.lang.String path)
          Loads a configuration file into memory.
 
Method Summary
 java.lang.String[] getValue(java.lang.String variable)
          Returns the values of a given variable.
 java.util.Iterator getVariables()
          Returns all defined variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationFile

public ConfigurationFile(java.lang.String path)
                  throws ConfigurationException
Loads a configuration file into memory.

Parameters:
path - the path to the configuration file; the path is given as an URL relative to the base directory of the program
Throws:
ConfigurationException - if there is any problem while loading the configuration data
Method Detail

getValue

public java.lang.String[] getValue(java.lang.String variable)
Returns the values of a given variable.

Parameters:
variable - the variable name
Returns:
an array of length 1 or more containing all the parameters given to the variable

getVariables

public java.util.Iterator getVariables()
Returns all defined variables.

Returns:
an iterator over all defined variable names