Package nz.org.riskscape.engine.ini
Class IniParser
java.lang.Object
nz.org.riskscape.engine.ini.IniParser
Provides methods to parse INI files with defined settings - multi section enabled allowing duplicate sections and keys - escape new lines allowing values to span multiple lines - set escape false, so Windows paths don't need excessive escaping.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.ini4j.Ini
parse
(InputStream input) ParsesInputStream
as INI format.static org.ini4j.Ini
Parses resource atURI
as INI format.static LinkedHashMap<String,
List<?>> toMap
(org.ini4j.Profile.Section section) Helper method for converting an ini section to a map, preserving all the values with the same key, but losing all the ordering information.
-
Constructor Details
-
IniParser
public IniParser()
-
-
Method Details
-
parse
Parses resource at
URI
as INI format.- Parameters:
uri
- to object ini content from- Returns:
- ini
- Throws:
nz.org.riskscape.engine.RiskscapeIOException
- if input is not valid INI format or not accessible
-
parse
public static org.ini4j.Ini parse(InputStream input) throws nz.org.riskscape.engine.RiskscapeIOException Parses
InputStream
as INI format.- Parameters:
input
- stream to parse- Returns:
- ini
- Throws:
nz.org.riskscape.engine.RiskscapeIOException
- if input is not valid INI format or not accessible
-
toMap
Helper method for converting an ini section to a map, preserving all the values with the same key, but losing all the ordering information.
-