Class IniFile

java.lang.Object
com.l2fprod.util.IniFile

public class IniFile extends Object
Version:
$Revision: 1.5 $, $Date: 2005/11/19 09:26:22 $
Author:
$Author: l2fprod $
  • Constructor Details

    • IniFile

      public IniFile()
      Constructor for the IniFile object
    • IniFile

      public IniFile(String filename) throws FileNotFoundException
      Constructor for the IniFile object
      Parameters:
      filename - Description of Parameter
      Throws:
      FileNotFoundException - Description of Exception
    • IniFile

      public IniFile(URL url) throws IOException
      Constructor for the IniFile object
      Parameters:
      url - Description of Parameter
      Throws:
      IOException - Description of Exception
    • IniFile

      public IniFile(InputStream input)
      Constructor for the IniFile object
      Parameters:
      input - Description of Parameter
  • Method Details

    • setKeyValue

      public void setKeyValue(String section, String key, String value)
      Sets the KeyValue attribute of the IniFile object
      Parameters:
      section - The new KeyValue value
      key - The new KeyValue value
      value - The new KeyValue value
    • getSections

      public Hashtable getSections()
      Gets the Sections attribute of the IniFile object
      Returns:
      The Sections value
    • getSection

      public Hashtable getSection(String section)
      Gets the Section attribute of the IniFile object
      Parameters:
      section - Description of Parameter
      Returns:
      The Section value
    • isNullOrEmpty

      public boolean isNullOrEmpty(String section, String key)
      Gets the NullOrEmpty attribute of the IniFile object
      Parameters:
      section - Description of Parameter
      key - Description of Parameter
      Returns:
      The NullOrEmpty value
    • getKeyValue

      public String getKeyValue(String section, String key)
      Gets the KeyValue attribute of the IniFile object
      Parameters:
      section - Description of Parameter
      key - Description of Parameter
      Returns:
      The KeyValue value
    • getKeyIntValue

      public int getKeyIntValue(String section, String key)
      Gets the KeyIntValue attribute of the IniFile object
      Parameters:
      section - Description of Parameter
      key - Description of Parameter
      Returns:
      The KeyIntValue value
    • getKeyIntValue

      public int getKeyIntValue(String section, String key, int defaultValue)
      Gets the KeyIntValue attribute of the IniFile object
      Parameters:
      section - Description of Parameter
      key - Description of Parameter
      defaultValue - Description of Parameter
      Returns:
      The KeyIntValue value
    • getKeyBooleanValue

      public boolean getKeyBooleanValue(String section, String key, boolean defaultValue)
      return true if the value of the key is yes/true, false if no/false, defaultValue in all other cases.
      Parameters:
      section -
      key -
      defaultValue -
    • getKeysAndValues

      public String[][] getKeysAndValues(String aSection)
      Gets the KeysAndValues attribute of the IniFile object
      Parameters:
      aSection - Description of Parameter
      Returns:
      The KeysAndValues value
    • getSectionWhere

      public String getSectionWhere(String[][] query)
    • load

      public void load(String filename) throws FileNotFoundException
      Description of the Method
      Parameters:
      filename - Description of Parameter
      Throws:
      FileNotFoundException - Description of Exception
    • save

      public void save(String filename) throws IOException
      Description of the Method
      Parameters:
      filename - Description of Parameter
      Throws:
      IOException - Description of Exception
    • load

      public void load(InputStream in)
      Description of the Method
      Parameters:
      in - Description of Parameter
    • save

      public void save(OutputStream out)
      Description of the Method
      Parameters:
      out - Description of Parameter
    • addSection

      public void addSection(String section)
      Adds a feature to the Section attribute of the IniFile object
      Parameters:
      section - The feature to be added to the Section attribute
    • removeSection

      public void removeSection(String section)
      Description of the Method
      Parameters:
      section - Description of Parameter
    • main

      public static void main(String[] args) throws Exception
      Simple test function
      Parameters:
      args - The command line arguments
      Throws:
      Exception - Description of Exception