Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.util
Class PropertiesFile

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by eu.esdihumboldt.util.PropertiesFile
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public class PropertiesFile
extends Properties

Properties bound to a file. The file is assumed to use the ISO 8859-1 character encoding; that is each byte is one Latin1 character. Characters not in Latin1, and certain special characters, are represented in keys and elements using Unicode escapes.

Author:
Simon Templer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
PropertiesFile(File file)
          Create or load the given properties file.
PropertiesFile(File file, Properties defaults)
          Create or load the given properties file.
 
Method Summary
 void reload()
          Reload the properties from the file.
 void save()
          Save the properties to the file, overwriting it.
 void sync(boolean preferRuntime)
          Sync the properties with the file.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertiesFile

public PropertiesFile(File file)
               throws IOException
Create or load the given properties file.

Parameters:
file - the properties file
Throws:
IOException - if creating or loading the file fails

PropertiesFile

public PropertiesFile(File file,
                      Properties defaults)
               throws IOException
Create or load the given properties file.

Parameters:
file - the properties file
defaults - the default properties
Throws:
IOException - if creating or loading the file fails
Method Detail

reload

public void reload()
            throws IOException
Reload the properties from the file.

Throws:
IOException - if loading the file fails

save

public void save()
          throws IOException
Save the properties to the file, overwriting it.

Throws:
IOException - if saving the file fails

sync

public void sync(boolean preferRuntime)
          throws IOException
Sync the properties with the file. For duplicate properties you can either prefer the runtime property values or the file property values.

Parameters:
preferRuntime - if the runtime properties should be preferred
Throws:
IOException - if loading or saving the file fails

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d