public class IniFile
extends java.lang.Object
[STARTUP]
FILENAME = file:///java/src/config.ini
PARAMS = None
[DICTIONARY]
CANCEL = Abbrechen
APPLY = Anwenden
Uppercase and lowercase letters will not be changed
unless the variable is renamed. Keywords do not contain
white spaces and the '=' or ':' sign.
Comments are allowed and should be lead by the following
character: ';'
Modifier and Type | Field and Description |
---|---|
static int |
COMMENT |
protected IniFileSection |
currentSection |
protected static FwkDescriptionInterface |
descriptor |
static int |
EMPTY |
static int |
ENTRY |
static int |
HEADER |
protected java.io.File |
iniFile |
protected java.util.Hashtable |
sectionHash |
protected java.util.ArrayList |
sectionList |
static java.lang.String |
version |
Constructor and Description |
---|
IniFile() |
IniFile(java.lang.String filename)
The constructor receiving the filename ot be read.
|
IniFile(java.net.URL url)
The constructor receiving the url to be read.
|
Modifier and Type | Method and Description |
---|---|
static FwkDescriptionInterface |
getDescriptor() |
java.io.File |
getFile()
Get the initialization file descriptor.
|
int |
getSectionCount()
Get the number of sections ini the INI-File.
|
java.lang.String |
getVersion() |
java.util.ArrayList |
listSections(java.lang.String pattern)
List known service names.
|
static void |
main(java.lang.String[] args) |
protected void |
parseToSection(java.lang.String line)
Parse the current line and put it into the
current section.
|
void |
read(java.io.InputStreamReader fileReader)
Read an initialization from stream.
|
void |
read(java.lang.String filename)
Read an initialization file.
|
void |
read(java.net.URL url)
Read an initialization file from URL.
|
void |
write(java.lang.String filename)
Write an initialzation file.
|
public static final java.lang.String version
protected static final FwkDescriptionInterface descriptor
public static final int EMPTY
public static final int COMMENT
public static final int HEADER
public static final int ENTRY
protected java.util.ArrayList sectionList
protected java.util.Hashtable sectionHash
protected IniFileSection currentSection
protected java.io.File iniFile
public IniFile()
public IniFile(java.lang.String filename)
filename
- The name of the file.public IniFile(java.net.URL url)
url
- The url of the file.public java.lang.String getVersion()
public static FwkDescriptionInterface getDescriptor()
public int getSectionCount()
public java.io.File getFile()
public java.util.ArrayList listSections(java.lang.String pattern)
pattern
- The filter pattern.public void read(java.lang.String filename)
filename
- The name of the initialization file to be read.public void read(java.net.URL url)
url
- The URL to the initialization file to be read.public void read(java.io.InputStreamReader fileReader)
fileRead
- The reader of the initialization file to be read.public void write(java.lang.String filename)
filename
- The name of the initialization file to be written.protected void parseToSection(java.lang.String line)
line
- Then next line from the input file.public static void main(java.lang.String[] args)