Class IniParser

java.lang.Object
nz.org.riskscape.engine.ini.IniParser

public class IniParser extends Object

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 Details

    • IniParser

      public IniParser()
  • Method Details

    • parse

      public static org.ini4j.Ini parse(URI uri) throws nz.org.riskscape.engine.RiskscapeIOException

      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

      public 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.