Propertiesfiles in a format to maximize the ability for diff tools (like
git diff) to represent changes. This is accomplished with the following steps:
- Always use UNIX newlines (
'\n') on all platforms.
- Change Unicode escapes
\\uhhhhfor compatibility with
native2asciiand files saved by NetBeans.
- Make all multi-line values span multiple lines. Add an escaped newline after any "\n" that is not at the end of the line already. The next line will be prefixed with a "\" if it starts with whitespace.
For maximum diffability, this should be used along with
Nested Class SummaryModifier and TypeClassDescription
Method SummaryModifier and TypeMethodDescriptionRewrites the given file, if modified.
static StringFormats a properties file provided as a String.
static voidRewrites the given files, if modified.
formatPropertiesFormats a properties file provided as a String. The file may contain Unicode values as supported by Java 9+.
The file encoding is not performed by this method. For Java <= 8, this should be stored in the ISO8859-1 encoding. For Java >= 9, this may be stored in the UTF-8 encoding.
formatPropertiesRewrites the given file, if modified. Reads and writes the files in ISO8859-1 encoding.
mainpublic static void main
(String args)Rewrites the given files, if modified. Reads and writes the files in ISO8859-1 encoding.