org.apache.qpid.info.util
Class IniFileReader

java.lang.Object
  extended by org.apache.qpid.info.util.IniFileReader

public class IniFileReader
extends Object

This class is simple implementation of an ini file reader. It expects a file with the following structure: ; global values, can be overwritten in sections key1=value1 key2=value2 [Section1] key1=value1_new ; overwriting the global key1 key3=value3 key4=value4 [Section2] key5=value5 key6=value6 key7=value7 Note: Commentaries are preceded by ; or # and are supported throughout A commentary line at the end of section is interpreted as a section end marker A structure (section name, associated properties) is generated as a result of processing the ini file.


Nested Class Summary
(package private) static class IniFileReader.State
           
 
Constructor Summary
IniFileReader()
           
 
Method Summary
 Map<String,Properties> getSections()
          Getter for the Sections Map
 void load(String fileName)
          Loads and parses the ini file with the full path specified in the argument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IniFileReader

public IniFileReader()
Method Detail

load

public void load(String fileName)
          throws IllegalArgumentException
Loads and parses the ini file with the full path specified in the argument

Parameters:
fileName - Full path to the ini file
Throws:
IllegalArgumentException - If the file cannot be processed

getSections

public Map<String,Properties> getSections()
Getter for the Sections Map

Returns:
Map The parsed content of the ini file in this structure


Licensed to the Apache Software Foundation