com.ericdaugherty.mail.server.utils
Class JESProperties

java.lang.Object
  extended by com.ericdaugherty.mail.server.utils.JESProperties

public class JESProperties
extends java.lang.Object

This class add to a pre 1.6 Java version the ability to handle a properties class without the limitation of using unicode escape sequences to persist non iso-8859-1 characters to a file. All the terms regarding the processing of properties are inhereted from the properties class with the obvious exception refered to before. Any character set encoding can be used as long as the java virtual machine instatiating this class supports it. The file encoding is not allowed to be altered and is only declared in the class constructor. Thus the properties will be saved in the same format as the one defined during the creation of an instance of this class. For this to be achieved, one should not attempt to save the properties via a call to a store method of the properties instanced class but rather to one of the store methods in this class. Static methods are provided to save properties to a file when JESProperties was not used to load the properties from disk.

Author:
Andreas Kyrmegalos

Constructor Summary
JESProperties(DelimitedInputStream dis)
           
JESProperties(DelimitedInputStream dis, java.lang.String fileEncoding)
           
 
Method Summary
 java.util.Properties getProperties()
           
 void load()
           
 void store(java.io.File target, java.lang.String comments)
           
static void store(java.util.Properties properties, java.io.File target, java.lang.String comments)
           
static void store(java.util.Properties properties, java.lang.String fileEncoding, java.io.File target, java.lang.String comments)
           
static void store(java.util.Properties properties, java.lang.String target, java.lang.String comments)
           
static void store(java.util.Properties properties, java.lang.String fileEncoding, java.lang.String target, java.lang.String comments)
           
 void store(java.lang.String target, java.lang.String comments)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JESProperties

public JESProperties(DelimitedInputStream dis)
              throws java.io.IOException
Throws:
java.io.IOException

JESProperties

public JESProperties(DelimitedInputStream dis,
                     java.lang.String fileEncoding)
              throws java.io.IOException
Throws:
java.io.IOException
Method Detail

load

public void load()
          throws java.io.IOException
Throws:
java.io.IOException

store

public void store(java.lang.String target,
                  java.lang.String comments)
           throws java.io.IOException
Throws:
java.io.IOException

store

public void store(java.io.File target,
                  java.lang.String comments)
           throws java.io.IOException
Throws:
java.io.IOException

store

public static void store(java.util.Properties properties,
                         java.lang.String fileEncoding,
                         java.lang.String target,
                         java.lang.String comments)
                  throws java.io.IOException
Throws:
java.io.IOException

store

public static void store(java.util.Properties properties,
                         java.lang.String target,
                         java.lang.String comments)
                  throws java.io.IOException
Throws:
java.io.IOException

store

public static void store(java.util.Properties properties,
                         java.lang.String fileEncoding,
                         java.io.File target,
                         java.lang.String comments)
                  throws java.io.IOException
Throws:
java.io.IOException

store

public static void store(java.util.Properties properties,
                         java.io.File target,
                         java.lang.String comments)
                  throws java.io.IOException
Throws:
java.io.IOException

getProperties

public java.util.Properties getProperties()