- java.lang.Object
-
- util.io.IniFileReader
-
public class IniFileReader extends java.lang.Object
This class reads Ini-Files. Ini-Files are Property-Files with [sections] and Key=Value Text Each [Section] is loaded into an unique HashMap.
-
-
Constructor Summary
Constructors Constructor Description IniFileReader(java.io.File iniFile)
Loads the Ini-FileIniFileReader(java.io.InputStream stream)
Loads the Ini from a InputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getAllSections()
Gets all available Sections in the loaded Ini-Filejava.util.HashMap<java.lang.String,java.lang.String>
getSection(java.lang.String section)
Get a specific "Section" of the Ini-File.
-
-
-
Constructor Detail
-
IniFileReader
public IniFileReader(java.io.File iniFile) throws java.io.IOException
Loads the Ini-File- Parameters:
iniFile
- File to load- Throws:
java.io.IOException
- Thrown if an IO operation went wrong.
-
IniFileReader
public IniFileReader(java.io.InputStream stream) throws java.io.IOException
Loads the Ini from a InputStream- Parameters:
stream
- Stream with Ini-File- Throws:
java.io.IOException
- Thrown if an IO operation went wrong.
-
-
Method Detail
-
getSection
public java.util.HashMap<java.lang.String,java.lang.String> getSection(java.lang.String section)
Get a specific "Section" of the Ini-File. Each Key=Value is stored in the HashMap as Key = Value- Parameters:
section
- Section to return- Returns:
- Specific Section as HashMap
-
getAllSections
public java.lang.String[] getAllSections()
Gets all available Sections in the loaded Ini-File- Returns:
- array of sections
-
-