public class PropertiesWriter extends Object
| Constructor and Description |
|---|
PropertiesWriter(OutputStream outputStream)
Creates a new property writer with default sperator (,).
|
PropertiesWriter(OutputStream outputStream,
String separator)
Creates a new property writer with a custom separator.
|
| Modifier and Type | Method and Description |
|---|---|
PropertiesWriter |
append()
Appends an empty line
|
PropertiesWriter |
append(String comment)
Appends a comment to be written.
|
PropertiesWriter |
append(String key,
String value)
Appends a property to be written.
|
PropertiesWriter |
appendRaw(String value)
Appends a raw value = will be exactely as recived.
|
void |
write()
Write properties to output stream.
|
public PropertiesWriter(OutputStream outputStream)
outputStream - the output stream to write properties to.public PropertiesWriter(OutputStream outputStream, String separator)
outputStream - the output stream to write properties to.separator - separator to be used to separate multiple propertiesorg.ops4j.lang.NullArgumentException - if output stream or separator are nullpublic PropertiesWriter append(String key, String value)
key - key of propertyvalue - value of propertyorg.ops4j.lang.NullArgumentException - if key is null or emptypublic PropertiesWriter append(String comment)
comment - The comment to add to the Properties file.public PropertiesWriter append()
public PropertiesWriter appendRaw(String value)
value - a raw valuepublic void write()
throws IOException
IOException - re-thrown from output streamCopyright © 2006–2019 OPS4J - Open Participation Software for Java. All rights reserved.