org.nukesoft.botutil
Class ConfManager

java.lang.Object
  |
  +--org.nukesoft.botutil.ConfManager

public class ConfManager
extends Object

The ConfManager simplifies access to an XML based configuration file. It manages the file management and the data location. This class acts as a wrapper for the TXML library. (http://sourceforge.net/projects/txml/)

Author:
Ryan Michela

Constructor Summary
ConfManager(String confPath)
          Creates a confuguration manager and loads a file.
ConfManager(String confPath, boolean globalize)
          Creates a confuguration manager and loads a file.
 
Method Summary
 String getConfString(String confPath)
          Loads a string from the configuration file.
static ConfManager getGlobalConf()
          Gets the global configuration manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfManager

public ConfManager(String confPath)
            throws IOException
Creates a confuguration manager and loads a file.

Parameters:
confPath - The path to the confuguration file to load.
Throws:
IOException

ConfManager

public ConfManager(String confPath,
                   boolean globalize)
            throws IOException
Creates a confuguration manager and loads a file. Optionaly assigns the global config.

Parameters:
confPath - The path to the confuguration file to load.
globalize - Set to TRUE if you want this configuration file to be the global config.
Throws:
IOException
Method Detail

getConfString

public String getConfString(String confPath)
                     throws IOException
Loads a string from the configuration file.

Parameters:
confPath - The path in the configuration heiarchy to load. Format: //Node/Node/Node/Element
Returns:
The value of the target node.
Throws:
IOException

getGlobalConf

public static ConfManager getGlobalConf()
Gets the global configuration manager.

Returns:
The global ConfManager.