Class PropertiesConfiguration.JupIOFactory

java.lang.Object
org.apache.commons.configuration2.PropertiesConfiguration.JupIOFactory
All Implemented Interfaces:
PropertiesConfiguration.IOFactory
Enclosing class:
PropertiesConfiguration

An alternative PropertiesConfiguration.IOFactory that tries to mimic the behavior of Properties (Jup) more closely. The goal is to allow both of them be used interchangeably when reading and writing properties files without losing or changing information.

It also has the option to not use Unicode escapes. When using UTF-8 encoding (which is e.g. the new default for resource bundle properties files since Java 9), Unicode escapes are no longer required and avoiding them makes properties files more readable with regular text editors.

Some of the ways this implementation differs from PropertiesConfiguration.DefaultIOFactory:

  • Trailing whitespace will not be trimmed from each line.
  • Unknown escape sequences will have their backslash removed.
  • \b is not a recognized escape sequence.
  • Leading spaces in property values are preserved by escaping them.
  • All natural lines (i.e. in the file) of a logical property line will have their leading whitespace trimmed.
  • Natural lines that look like comment lines within a logical line are not treated as such; they're part of the property value.
Since:
2.4