to.etc.util
Class ConfigFile

java.lang.Object
  extended by to.etc.util.ConfigFile
All Implemented Interfaces:
ConfigSource

Deprecated.

@Deprecated
public class ConfigFile
extends java.lang.Object
implements ConfigSource

Encapsulates a config file. The config file looks like a properties file, but it's keys are case-independent. The config file can be set to be reread every n seconds. It can also write the file. The file format is the same as the property file format, and allows comments before items.

Author:
Frits Jalvingh

Constructor Summary
ConfigFile()
          Deprecated.  
ConfigFile(ConfigFile default_cf)
          Deprecated.  
ConfigFile(java.io.File cf)
          Deprecated.  
ConfigFile(java.io.File f, java.io.File localf)
          Deprecated.  
 
Method Summary
 java.io.File getFile()
          Deprecated.  
 java.lang.String getOption(java.lang.String key)
          Deprecated.  
 int getProp(java.lang.String name, int defval)
          Deprecated. Returns an int property.
 java.lang.String getProp(java.lang.String name, java.lang.String defval)
          Deprecated. Returns a string property.
 java.lang.Object getSourceObject()
          Deprecated.  
 ConfigSource getSubSource(java.lang.String key)
          Deprecated.  
 void setFile(java.io.File f)
          Deprecated. Called to set the file to use.
 void setProp(java.lang.String key, int val, java.lang.String comment)
          Deprecated. Sets a int property.
 void setProp(java.lang.String key, java.lang.String val, java.lang.String comment)
          Deprecated. Sets a string property.
 void setSearchFile(java.lang.String fin)
          Deprecated. Sets a file and searches the path for it.
 java.lang.String toString()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfigFile

public ConfigFile()
Deprecated. 

ConfigFile

public ConfigFile(ConfigFile default_cf)
Deprecated. 

ConfigFile

public ConfigFile(java.io.File cf)
           throws java.lang.Exception
Deprecated. 
Throws:
java.lang.Exception

ConfigFile

public ConfigFile(java.io.File f,
                  java.io.File localf)
           throws java.lang.Exception
Deprecated. 
Throws:
java.lang.Exception
Method Detail

setFile

public void setFile(java.io.File f)
             throws java.lang.Exception
Deprecated. 
Called to set the file to use. The file MUST exist or it is not set.

Throws:
java.lang.Exception

setSearchFile

public void setSearchFile(java.lang.String fin)
                   throws java.lang.Exception
Deprecated. 
Sets a file and searches the path for it. The classpath is scanned. If no extension is set this looks for .properties

Throws:
java.lang.Exception

getSubSource

public ConfigSource getSubSource(java.lang.String key)
Deprecated. 
Specified by:
getSubSource in interface ConfigSource

getFile

public java.io.File getFile()
Deprecated. 

toString

public java.lang.String toString()
Deprecated. 
Overrides:
toString in class java.lang.Object

getProp

public java.lang.String getProp(java.lang.String name,
                                java.lang.String defval)
                         throws java.lang.Exception
Deprecated. 
Returns a string property.

Throws:
java.lang.Exception

getProp

public int getProp(java.lang.String name,
                   int defval)
            throws java.lang.Exception
Deprecated. 
Returns an int property.

Throws:
java.lang.Exception

setProp

public void setProp(java.lang.String key,
                    java.lang.String val,
                    java.lang.String comment)
             throws java.lang.Exception
Deprecated. 
Sets a string property. This always sets the base, not the defaults file.

Throws:
java.lang.Exception

setProp

public void setProp(java.lang.String key,
                    int val,
                    java.lang.String comment)
             throws java.lang.Exception
Deprecated. 
Sets a int property.

Throws:
java.lang.Exception

getOption

public java.lang.String getOption(java.lang.String key)
                           throws java.lang.Exception
Deprecated. 
Specified by:
getOption in interface ConfigSource
Throws:
java.lang.Exception

getSourceObject

public java.lang.Object getSourceObject()
Deprecated. 
Specified by:
getSourceObject in interface ConfigSource