Table of Contents
API Documentation: | WriteProperties |
---|
Writes a Properties
in a way that the results can be expected to be reproducible.
There are a number of differences compared to how properties are stored:
- no timestamp comment is generated at the beginning of the file
- the lines in the resulting files are separated by a pre-set separator (defaults to '\n') instead of the system default line separator
- the properties are sorted alphabetically
Like with Properties
, Unicode characters are escaped when using the
default Latin-1 (ISO-8559-1) encoding.
Property | Description |
comment | The optional comment to add at the beginning of the properties file. |
encoding | The encoding used to write the properties file. Defaults to ISO_8859_1. If set to anything different, unicode escaping is turned off. |
lineSeparator | The line separator to be used when creating the properties file. Defaults to `\n`. |
outputFile | The output file to write the properties to. |
properties | Returns an immutable view of properties to be written to the properties file. |
Method | Description |
properties(properties) | Adds multiple properties to be written to the properties file. |
property(name, value) | Adds a property to be written to the properties file. |
String
encoding
The encoding used to write the properties file. Defaults to ISO_8859_1. If set to anything different, unicode escaping is turned off.
- Default:
ISO-8859-1
String
lineSeparator
The line separator to be used when creating the properties file. Defaults to `\n`.
- Default:
'\n'
Adds multiple properties to be written to the properties file.
This is a convenience method for calling WriteProperties.property(java.lang.String, java.lang.Object)
multiple times.