org.omnaest.utils.propertyfile
Class PropertyFile

java.lang.Object
  extended by org.omnaest.utils.propertyfile.PropertyFile

public class PropertyFile
extends Object

Representation of a property file. Offers methods to load, modify and store property files.

This API supports minimal invasive modification which means that existing comments or blank lines are not discarded.

Author:
Omnaest
See Also:
load(), store(), PropertyFileContent

Field Summary
protected  File file
           
static String FILE_ENCODING_DEFAULT
           
protected  String fileEncoding
           
protected  PropertyFileContent propertyFileContent
           
 
Constructor Summary
PropertyFile(File propertyFile)
           
PropertyFile(String propertyFileName)
           
 
Method Summary
 File getFile()
           
 String getFileEncoding()
           
 PropertyFileContent getPropertyFileContent()
           
 void load()
          Loads the PropertyFile from disc.
 void load(String fileContent)
          Loads the PropertyFile from the given String
 void setFile(File file)
           
 void setFileEncoding(String fileEncoding)
           
 void setPropertyFileContent(PropertyFileContent propertyFileContent)
           
 void store()
          Stores the PropertyFile to disc.
 String toString()
          Returns a String version of the current PropertyFileContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILE_ENCODING_DEFAULT

public static final String FILE_ENCODING_DEFAULT
See Also:
Constant Field Values

file

protected File file

fileEncoding

protected String fileEncoding

propertyFileContent

protected PropertyFileContent propertyFileContent
Constructor Detail

PropertyFile

public PropertyFile(String propertyFileName)

PropertyFile

public PropertyFile(File propertyFile)
Method Detail

load

public void load()
Loads the PropertyFile from disc.


load

public void load(String fileContent)
Loads the PropertyFile from the given String

Parameters:
fileContent -

toString

public String toString()
Returns a String version of the current PropertyFileContent

Overrides:
toString in class Object

store

public void store()
Stores the PropertyFile to disc.


getFile

public File getFile()

setFile

public void setFile(File file)

getPropertyFileContent

public PropertyFileContent getPropertyFileContent()

setPropertyFileContent

public void setPropertyFileContent(PropertyFileContent propertyFileContent)

getFileEncoding

public String getFileEncoding()

setFileEncoding

public void setFileEncoding(String fileEncoding)


Copyright © 2013. All Rights Reserved.