org.codehaus.mojo.appassembler.util
Class FormattedProperties
java.lang.Object
org.codehaus.mojo.appassembler.util.FormattedProperties
public class FormattedProperties
- extends Object
A class to read/write a properties file, and retain the formatting through modifications.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FormattedProperties
public FormattedProperties()
setProperty
public void setProperty(String key,
String value)
getProperty
public String getProperty(String key)
getProperty
public String getProperty(String key,
String defaultValue)
removeProperty
public void removeProperty(String key)
read
public void read(InputStream inputStream)
throws IOException
- Read in the properties from the given stream. Note that this will be used as the basis of the next formatted
write, even though properties from any previous read are still retained. This allows adding properties to the top
of the file.
- Parameters:
inputStream
- the stream to read from
- Throws:
IOException
- if there is a problem reading the stream
save
public void save(OutputStream outputStream)
setPropertyAfter
public void setPropertyAfter(String key,
String value,
String afterProperty)
Copyright © 2006-2011 Codehaus. All Rights Reserved.