Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://aoindustries.com/contact
public class DiffableProperties extends Object
Properties files in a format to maximize the ability for
diff tools (like git diff) to represent changes. This is
accomplished with the following steps:
'\n') on all platforms.\\uHHHH to lower-case \\uhhhh
for compatibility with native2ascii and files saved by
NetBeans.
For maximum diffability, this should be used along with SortedProperties.
Properties,
SortedProperties| Modifier and Type | Class and Description |
|---|---|
static class |
DiffableProperties.FormatResult |
| Modifier and Type | Method and Description |
|---|---|
static DiffableProperties.FormatResult |
formatProperties(File file)
Rewrites the given file, if modified.
|
static String |
formatProperties(String properties)
Formats a properties file provided as a String.
|
static void |
main(String[] args)
Rewrites the given files, if modified.
|
public static String formatProperties(String properties)
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.
public static DiffableProperties.FormatResult formatProperties(File file) throws IOException
DiffableProperties.FormatResult.getAfter() null
when the file unmodifiedIOExceptionpublic static void main(String[] args)
Copyright © 2000–2019 AO Industries, Inc.. All rights reserved.