|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.entrust.toolkit.util.IniFile
IniFile provides a convient format for storing program data in a file, based closely on MS-Windows 3.x "INI" files. An INI file consists of sections, keys and values. A section consists of related keys and values and all sections and keys must have a unique name.
eg.
[Section Name]
key = value
| Field Summary | |
protected Map |
m_sections
|
| Constructor Summary | |
IniFile()
Initializes IniFile |
|
IniFile(java.io.InputStream is)
Initializes IniFile using a generic input stream |
|
IniFile(java.lang.String filename)
Initializes IniFile with a specific filename |
|
| Method Summary | |
int |
getInt(java.lang.String section,
java.lang.String key)
Gets the value associated with the given key in the given section. |
Map |
getSection(int position)
Returns the sections by position within the inifile. |
java.util.Vector |
getSection(java.lang.String section)
Gets all of the entries (ie. |
java.lang.String |
getString(java.lang.String section,
java.lang.String key)
Gets the value associated with the given key in the given section. |
java.lang.String |
getString(java.lang.String section,
java.lang.String key,
java.lang.String defaultString)
Gets the value associated with the given key in the given section. |
boolean |
putInt(java.lang.String section,
java.lang.String key,
int anInt)
Puts the value associated with the given key in the given section into the IniFile. |
boolean |
putSection(java.lang.String section,
java.util.Vector strings)
Puts a given set of entries (ie. |
boolean |
putString(java.lang.String section,
java.lang.String key,
java.lang.String aString)
Puts the value associated with the given key in the given section into the IniFile. |
protected java.lang.String |
readSection(java.io.LineNumberReader reader,
java.lang.String aSection)
Parses a section entry from the given InputStream. |
void |
readStream(java.io.InputStream inputStream)
Builds an IniFile object from the given InputStream. |
void |
removeEntry(java.lang.String section,
java.lang.String entry)
Removes an entry from the IniFile. |
void |
removeSection(java.lang.String section)
Removes a section from the IniFile. |
void |
writeStream(java.io.OutputStream outputStream)
Writes this IniFile object to the given OutputStream. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected Map m_sections
| Constructor Detail |
public IniFile()
public IniFile(java.lang.String filename)
throws java.io.FileNotFoundException
filename - String containing the filenamepublic IniFile(java.io.InputStream is)
is - an InputStream| Method Detail |
public java.lang.String getString(java.lang.String section,
java.lang.String key)
section - The name of the section in the IniFile.key - The name of the key in the section.
public java.lang.String getString(java.lang.String section,
java.lang.String key,
java.lang.String defaultString)
section - The name of the section in the IniFile.key - The name of the key in the section.defaultString - The default value to return if nothing found
public int getInt(java.lang.String section,
java.lang.String key)
section - The name of the section in the IniFile.key - The name of the key in the section.public java.util.Vector getSection(java.lang.String section)
section - The name of the section in the IniFile.public Map getSection(int position)
position - The position of the section to return.
public boolean putString(java.lang.String section,
java.lang.String key,
java.lang.String aString)
section - The name of the section in the IniFile.key - The name of the key in the section.aString - The string value to map to this key
public boolean putInt(java.lang.String section,
java.lang.String key,
int anInt)
section - The name of the section in the IniFile.key - The name of the key in the section.anInt - The integer value to map to this key
public boolean putSection(java.lang.String section,
java.util.Vector strings)
section - The name of the section in the IniFile.strings - A Vector containing strings of entries, (ie. "key=value")
public void removeEntry(java.lang.String section,
java.lang.String entry)
section - Section nameentry - Entry name in the sectionpublic void removeSection(java.lang.String section)
section - Secton name
protected java.lang.String readSection(java.io.LineNumberReader reader,
java.lang.String aSection)
reader - A LineNumberReaderaSection - Section namepublic void readStream(java.io.InputStream inputStream)
inputStream - An input streampublic void writeStream(java.io.OutputStream outputStream)
outputStream - An input stream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||