Package com.l2fprod.util
Class IniFile
java.lang.Object
com.l2fprod.util.IniFile
- Version:
- $Revision: 1.5 $, $Date: 2005/11/19 09:26:22 $
- Author:
- $Author: l2fprod $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSection
(String section) Adds a feature to the Section attribute of the IniFile objectboolean
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.int
getKeyIntValue
(String section, String key) Gets the KeyIntValue attribute of the IniFile objectint
getKeyIntValue
(String section, String key, int defaultValue) Gets the KeyIntValue attribute of the IniFile objectString[][]
getKeysAndValues
(String aSection) Gets the KeysAndValues attribute of the IniFile objectgetKeyValue
(String section, String key) Gets the KeyValue attribute of the IniFile objectgetSection
(String section) Gets the Section attribute of the IniFile objectGets the Sections attribute of the IniFile objectgetSectionWhere
(String[][] query) boolean
isNullOrEmpty
(String section, String key) Gets the NullOrEmpty attribute of the IniFile objectvoid
load
(InputStream in) Description of the Methodvoid
Description of the Methodstatic void
Simple test functionvoid
removeSection
(String section) Description of the Methodvoid
save
(OutputStream out) Description of the Methodvoid
Description of the Methodvoid
setKeyValue
(String section, String key, String value) Sets the KeyValue attribute of the IniFile object
-
Constructor Details
-
IniFile
public IniFile()Constructor for the IniFile object -
IniFile
Constructor for the IniFile object- Parameters:
filename
- Description of Parameter- Throws:
FileNotFoundException
- Description of Exception
-
IniFile
Constructor for the IniFile object- Parameters:
url
- Description of Parameter- Throws:
IOException
- Description of Exception
-
IniFile
Constructor for the IniFile object- Parameters:
input
- Description of Parameter
-
-
Method Details
-
setKeyValue
Sets the KeyValue attribute of the IniFile object- Parameters:
section
- The new KeyValue valuekey
- The new KeyValue valuevalue
- The new KeyValue value
-
getSections
Gets the Sections attribute of the IniFile object- Returns:
- The Sections value
-
getSection
Gets the Section attribute of the IniFile object- Parameters:
section
- Description of Parameter- Returns:
- The Section value
-
isNullOrEmpty
Gets the NullOrEmpty attribute of the IniFile object- Parameters:
section
- Description of Parameterkey
- Description of Parameter- Returns:
- The NullOrEmpty value
-
getKeyValue
Gets the KeyValue attribute of the IniFile object- Parameters:
section
- Description of Parameterkey
- Description of Parameter- Returns:
- The KeyValue value
-
getKeyIntValue
Gets the KeyIntValue attribute of the IniFile object- Parameters:
section
- Description of Parameterkey
- Description of Parameter- Returns:
- The KeyIntValue value
-
getKeyIntValue
Gets the KeyIntValue attribute of the IniFile object- Parameters:
section
- Description of Parameterkey
- Description of ParameterdefaultValue
- Description of Parameter- Returns:
- The KeyIntValue value
-
getKeyBooleanValue
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
Gets the KeysAndValues attribute of the IniFile object- Parameters:
aSection
- Description of Parameter- Returns:
- The KeysAndValues value
-
getSectionWhere
-
load
Description of the Method- Parameters:
filename
- Description of Parameter- Throws:
FileNotFoundException
- Description of Exception
-
save
Description of the Method- Parameters:
filename
- Description of Parameter- Throws:
IOException
- Description of Exception
-
load
Description of the Method- Parameters:
in
- Description of Parameter
-
save
Description of the Method- Parameters:
out
- Description of Parameter
-
addSection
Adds a feature to the Section attribute of the IniFile object- Parameters:
section
- The feature to be added to the Section attribute
-
removeSection
Description of the Method- Parameters:
section
- Description of Parameter
-
main
Simple test function- Parameters:
args
- The command line arguments- Throws:
Exception
- Description of Exception
-