org.dtools.ini
Class IniFileWriter

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

public class IniFileWriter
extends Object

The IniFileWriter class is a simple class which allows the user to write an IniFile object to the hard disk. One of the class' greatest advantage is that it removes the complexity of writing files from the user.

Since:
0.1.14
Version:
0.3.0
Author:
David Lewis

Field Summary
static String ENCODING
          The text encoding for writing String to files.
 
Constructor Summary
IniFileWriter(IniFile ini, File file)
          Creates a new IniFileWriter thread instance.
 
Method Summary
 void setIncludeSpaces(boolean value)
          This method sets whether a space character should be placed before and after the equals character in an item.
 void setItemLineSeparator(boolean value)
          This method sets whether an empty line should be included before and after an item has occurred in the file.
 void setSectionLineSeparator(boolean value)
          This method sets whether an empty line should be included before and after a section has occurred in the file.
 void write()
          This method actually writes the IniFile to the File object (both of which are given in the constructor).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING

public static final String ENCODING
The text encoding for writing String to files.

Since:
0.1.16
See Also:
Constant Field Values
Constructor Detail

IniFileWriter

public IniFileWriter(IniFile ini,
                     File file)
Creates a new IniFileWriter thread instance.

Parameters:
ini - The IniFile to write.
file - The File where to write the IniFile to.
Since:
0.1.14
Method Detail

setIncludeSpaces

public void setIncludeSpaces(boolean value)
This method sets whether a space character should be placed before and after the equals character in an item.

Parameters:
value - If true, a space character is placed before and after the equals character.
Since:
0.3.0

setItemLineSeparator

public void setItemLineSeparator(boolean value)
This method sets whether an empty line should be included before and after an item has occurred in the file.

Parameters:
value - If true, an empty line will be included before and after an item.
Since:
0.3.0

setSectionLineSeparator

public void setSectionLineSeparator(boolean value)
This method sets whether an empty line should be included before and after a section has occurred in the file.

Parameters:
value - If true, an empty line will be included before and after a section.
Since:
0.3.0

write

public void write()
           throws IOException

This method actually writes the IniFile to the File object (both of which are given in the constructor).

Throws:
IOException - If an I\O exception occurs.
Since:
0.1.14