Class PropertiesUtils

java.lang.Object
org.apache.wiki.util.PropertiesUtils

public final class PropertiesUtils
extends Object
some useful methods for properties
  • Method Details

    • toSortedString

      public static String toSortedString​(Properties properties)

      like Properties.store, but stores the properties in sorted order

      Parameters:
      properties - the properties object
      Returns:
      String the properties, nicely formatted
    • toLine

      public static String toLine​(String key, String value)
      Generates a property file line from a supplied key and value.
      Parameters:
      key - the property's key
      value - the property's value
      Returns:
      the converted string
    • saveConvert

      public static String saveConvert​(String string, boolean encodeWhiteSpace)
      Encodes a property file string from a supplied key/value line.
      Parameters:
      string - the string to encode
      encodeWhiteSpace - true if whitespace should be encoded also
      Returns:
      the converted string