org.dtools.ini
Class IniFileReader

java.lang.Object
  extended by org.dtools.ini.IniFileReader

public class IniFileReader
extends Object

This class provides users an easy way to read INI files from the hard disk and parse them to an IniFile object.

Since:
0.1.14
Version:
1.1.0
Author:
David Lewis

Constructor Summary
IniFileReader(IniFile ini, File file)
          Default constructor, creates a new IniFileReader object which will read from the given file and populate the given data from the file into the given IniFile object.
 
Method Summary
 void read()
          This method begins the reading process of the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IniFileReader

public IniFileReader(IniFile ini,
                     File file)
Default constructor, creates a new IniFileReader object which will read from the given file and populate the given data from the file into the given IniFile object.

Parameters:
ini - The IniFile which will be populated.
file - The file that will be read as an INI file.
Since:
0.1.14
Method Detail

read

public void read()
          throws IOException

This method begins the reading process of the file. The method opens the input file, which is set in the constructor, reads each line from the file, and parse that file to the IniFile object, which is also set in the constructor.

If the method encounters a line of text from the string which it is unable to parse to the IniFile, then this method throws a FormatException exception.

Throws:
FormatException - If an error is encountered whilst reading the input file.
IOException - If an exception occurs whilst reading the file.
Since:
0.1.14