public class IniFile
extends java.lang.Object
| Constructor | Description |
|---|---|
IniFile() |
Constructor for the IniFile object
|
IniFile(java.io.InputStream input) |
Constructor for the IniFile object
|
IniFile(java.lang.String filename) |
Constructor for the IniFile object
|
IniFile(java.net.URL url) |
Constructor for the IniFile object
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addSection(java.lang.String section) |
Adds a feature to the Section attribute of the IniFile object
|
boolean |
getKeyBooleanValue(java.lang.String section,
java.lang.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(java.lang.String section,
java.lang.String key) |
Gets the KeyIntValue attribute of the IniFile object
|
int |
getKeyIntValue(java.lang.String section,
java.lang.String key,
int defaultValue) |
Gets the KeyIntValue attribute of the IniFile object
|
java.lang.String[][] |
getKeysAndValues(java.lang.String aSection) |
Gets the KeysAndValues attribute of the IniFile object
|
java.lang.String |
getKeyValue(java.lang.String section,
java.lang.String key) |
Gets the KeyValue attribute of the IniFile object
|
java.util.Hashtable |
getSection(java.lang.String section) |
Gets the Section attribute of the IniFile object
|
java.util.Hashtable |
getSections() |
Gets the Sections attribute of the IniFile object
|
java.lang.String |
getSectionWhere(java.lang.String[][] query) |
|
boolean |
isNullOrEmpty(java.lang.String section,
java.lang.String key) |
Gets the NullOrEmpty attribute of the IniFile object
|
void |
load(java.io.InputStream in) |
Description of the Method
|
void |
load(java.lang.String filename) |
Description of the Method
|
static void |
main(java.lang.String[] args) |
Simple test function
|
void |
removeSection(java.lang.String section) |
Description of the Method
|
void |
save(java.io.OutputStream out) |
Description of the Method
|
void |
save(java.lang.String filename) |
Description of the Method
|
void |
setKeyValue(java.lang.String section,
java.lang.String key,
java.lang.String value) |
Sets the KeyValue attribute of the IniFile object
|
public IniFile()
public IniFile(java.lang.String filename)
throws java.io.FileNotFoundException
filename - Description of Parameterjava.io.FileNotFoundException - Description of Exceptionpublic IniFile(java.net.URL url)
throws java.io.IOException
url - Description of Parameterjava.io.IOException - Description of Exceptionpublic IniFile(java.io.InputStream input)
input - Description of Parameterpublic void setKeyValue(java.lang.String section,
java.lang.String key,
java.lang.String value)
section - The new KeyValue valuekey - The new KeyValue valuevalue - The new KeyValue valuepublic java.util.Hashtable getSections()
public java.util.Hashtable getSection(java.lang.String section)
section - Description of Parameterpublic boolean isNullOrEmpty(java.lang.String section,
java.lang.String key)
section - Description of Parameterkey - Description of Parameterpublic java.lang.String getKeyValue(java.lang.String section,
java.lang.String key)
section - Description of Parameterkey - Description of Parameterpublic int getKeyIntValue(java.lang.String section,
java.lang.String key)
section - Description of Parameterkey - Description of Parameterpublic int getKeyIntValue(java.lang.String section,
java.lang.String key,
int defaultValue)
section - Description of Parameterkey - Description of ParameterdefaultValue - Description of Parameterpublic boolean getKeyBooleanValue(java.lang.String section,
java.lang.String key,
boolean defaultValue)
section - key - defaultValue - public java.lang.String[][] getKeysAndValues(java.lang.String aSection)
aSection - Description of Parameterpublic java.lang.String getSectionWhere(java.lang.String[][] query)
public void load(java.lang.String filename)
throws java.io.FileNotFoundException
filename - Description of Parameterjava.io.FileNotFoundException - Description of Exceptionpublic void save(java.lang.String filename)
throws java.io.IOException
filename - Description of Parameterjava.io.IOException - Description of Exceptionpublic void load(java.io.InputStream in)
in - Description of Parameterpublic void save(java.io.OutputStream out)
out - Description of Parameterpublic void addSection(java.lang.String section)
section - The feature to be added to the Section attributepublic void removeSection(java.lang.String section)
section - Description of Parameterpublic static void main(java.lang.String[] args)
throws java.lang.Exception
args - The command line argumentsjava.lang.Exception - Description of Exception