Class PropertyUtils


  • public final class PropertyUtils
    extends Object
    • Method Detail

      • getProperty

        public static String getProperty​(Properties properties,
                                         String propertyName)
        property string and substitutions
        Parameters:
        properties - The properties from which to fetch a value
        propertyName - The name of the desired property
        Returns:
        the value, with common substitutions performed
        See Also:
        commonSubstitutions(String)
      • getProperty

        public static String getProperty​(Properties properties,
                                         org.apache.commons.lang3.tuple.Pair<String,​String> propertyWithDefaultValue)
      • getProperty

        public static String getProperty​(Properties properties,
                                         String propertyName,
                                         String defaultValue)
        property string and substitutions
        Parameters:
        properties - The properties from which to fetch a value
        propertyName - The name of the desired property
        defaultValue - The value to use when the propertyName does not exist
        Returns:
        the value, with common substitutions performed
        See Also:
        commonSubstitutions(String)
      • commonSubstitutions

        public static String commonSubstitutions​(String input)
        Replaces percent-bounded expressions such as "%servletContext%." common substitutions in config values
        Parameters:
        input - A string with expressions that should be replaced
        Returns:
        new string with "common" expressions replaced by configuration values