com.autonomy.utilities
Class JavaConfig

java.lang.Object
  |
  +--com.autonomy.utilities.JavaConfig

Deprecated. This is no longer supported. Use the com.autonomy.config package to modify configuration files instead.

public class JavaConfig
extends java.lang.Object

Class to modify configuration files


Field Summary
static int JAVACONFIG_FAILURE
          Deprecated.  
static int JAVACONFIG_SUCCESS
          Deprecated.  
 
Constructor Summary
JavaConfig()
          Deprecated. JavaConfig Constructor.
JavaConfig(java.lang.String sFilename)
          Deprecated. Read in a file and convert it to a JavaConfig structure
JavaConfig(java.lang.StringBuffer sbInput)
          Deprecated. JavaConfig Constructor
 
Method Summary
 int addKey(java.lang.String sSectionName, java.lang.String sKeyName, java.lang.String sValueName)
          Deprecated. Add a key to the config
 int changeKey(java.lang.String sSectionName, java.lang.String sKeyName, java.lang.String sNewValue)
          Deprecated. Change a key in the specified section
 int createSection(java.lang.String sSectionName, java.util.Vector vElements)
          Deprecated. Add a section to the config file.
 int deleteKey(java.lang.String sSectionName, java.lang.String sKeyName)
          Deprecated. Deletes a Key from the config from the specified section
 int deleteSection(java.lang.String sSectionName)
          Deprecated. Delete a section from the config file.
 void display()
          Deprecated. Quick method to print out all of the sections
 java.lang.String find(java.lang.String keyName)
          Deprecated. Find the specified key
 java.lang.String getKey(java.lang.String sSectionName, java.lang.String sKeyName)
          Deprecated. Returns the value of a key
 int getNumberOfSections()
          Deprecated. Return the number of sections in the config
 java.lang.String getSection(java.lang.String sSectionName)
          Deprecated. Return the contents of a specified section
 java.lang.String[] getSectionHeadings(boolean bStripped)
          Deprecated. Get an array of section headings
 void parseStringBuffer(java.lang.StringBuffer sbInputBuffer)
          Deprecated. This method parses the specified StringBuffer into the hashtable
 java.lang.StringBuffer readConfigFile(java.lang.String sFilename)
          Deprecated. Read in a config file and put it into a StringBuffer, for use later
 java.lang.StringBuffer returnConfig()
          Deprecated. Return the Configuration
 int writeConfig(java.lang.String sConfigFileName, boolean dosFormat)
          Deprecated. Write the config out to a file on disk
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVACONFIG_SUCCESS

public static int JAVACONFIG_SUCCESS
Deprecated. 

JAVACONFIG_FAILURE

public static int JAVACONFIG_FAILURE
Deprecated. 
Constructor Detail

JavaConfig

public JavaConfig()
Deprecated. 
JavaConfig Constructor.


JavaConfig

public JavaConfig(java.lang.StringBuffer sbInput)
Deprecated. 
JavaConfig Constructor

Parameters:
sbInput - the String buffer to extract the config from

JavaConfig

public JavaConfig(java.lang.String sFilename)
           throws java.io.FileNotFoundException
Deprecated. 
Read in a file and convert it to a JavaConfig structure

Parameters:
sFilename - Fully Qualified Path of the config file to read
Throws:
java.io.FileNotFoundException - if the filename passed does not exists
Method Detail

readConfigFile

public java.lang.StringBuffer readConfigFile(java.lang.String sFilename)
                                      throws java.io.FileNotFoundException
Deprecated. 
Read in a config file and put it into a StringBuffer, for use later

Parameters:
sFilename - Fully Qualified Path of the config file to read
java.io.FileNotFoundException

getSection

public java.lang.String getSection(java.lang.String sSectionName)
Deprecated. 
Return the contents of a specified section

Parameters:
sSectionName - Section to return
Returns:
the Section contents. This is an empty string if the section was not found.

createSection

public int createSection(java.lang.String sSectionName,
                         java.util.Vector vElements)
Deprecated. 
Add a section to the config file.

Parameters:
sSectionName - Section to add
vElements - Vector containing key-pair information in the format : KEY=VALUE [white space is ignored] Each separate key-pair must be an element of the Vector
Returns:
int indicates whether adding the section was successful or not. 0 is SUCCESS, -1 is FAILURE

deleteSection

public int deleteSection(java.lang.String sSectionName)
Deprecated. 
Delete a section from the config file. This will delete all sections with this name

Parameters:
sSectionName - Section to delete
Returns:
an int representing whether the operation was successful or not. 0 means SUCCESS, -1 means FAILURE

getKey

public java.lang.String getKey(java.lang.String sSectionName,
                               java.lang.String sKeyName)
Deprecated. 
Returns the value of a key

Parameters:
sSectionName - Name of the section in which the key resides. If you don't know, use the find function
sKeyName - Name of the key value to return,
Returns:
the value of the specified key. If the key cannot be found, an empty string is returned

addKey

public int addKey(java.lang.String sSectionName,
                  java.lang.String sKeyName,
                  java.lang.String sValueName)
Deprecated. 
Add a key to the config

Parameters:
sSectionName - Section in which to place the key
sKeyName - Keyname
sValueName - Value for the key
Returns:
int indicates whether adding the key was successful or not. 0 is SUCCESS, -1 is FAILURE

deleteKey

public int deleteKey(java.lang.String sSectionName,
                     java.lang.String sKeyName)
Deprecated. 
Deletes a Key from the config from the specified section

Parameters:
sSectionName - section from which to delete the key
sKeyName - key to delete
Returns:
int indicates whether deleting the key was successful or not. 0 is SUCCESS, -1 is FAILURE

find

public java.lang.String find(java.lang.String keyName)
Deprecated. 
Find the specified key

Parameters:
keyName - key to find
Returns:
a CSV String of the section(s) which contains this key. If nothing is found, this returns an empty string

changeKey

public int changeKey(java.lang.String sSectionName,
                     java.lang.String sKeyName,
                     java.lang.String sNewValue)
Deprecated. 
Change a key in the specified section

Parameters:
sSectionName - section in which the key resides
sKeyName - key to change
sNewValue - new value for the key

getNumberOfSections

public int getNumberOfSections()
Deprecated. 
Return the number of sections in the config

Returns:
number of sections

getSectionHeadings

public java.lang.String[] getSectionHeadings(boolean bStripped)
Deprecated. 
Get an array of section headings

Parameters:
bStripped - to indicate whether you want to remove the [ and ] delimiters
Returns:
an array of section headings. Returns null if there are no sections in the config

parseStringBuffer

public void parseStringBuffer(java.lang.StringBuffer sbInputBuffer)
Deprecated. 
This method parses the specified StringBuffer into the hashtable


display

public void display()
Deprecated. 
Quick method to print out all of the sections


returnConfig

public java.lang.StringBuffer returnConfig()
Deprecated. 
Return the Configuration

Returns:
the config file

writeConfig

public int writeConfig(java.lang.String sConfigFileName,
                       boolean dosFormat)
Deprecated. 
Write the config out to a file on disk

Parameters:
sConfigFileName - Name of the config file to create
dosFormat - whether to end each line with \n\r or just \n
Returns:
int An Integer to indicate success or failure. 0 is Success, -1 is Failure