Class EnvUtil


  • public final class EnvUtil
    extends java.lang.Object
    EnvUtil
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PREFIX_ENV  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String evaluate​(java.lang.String strSource)
      Evaluate a string that may contain a reference to an environement variable enclosed by ${...}
      static java.lang.String evaluate​(java.lang.String strSource, java.lang.String strEnvPrefix)
      Evaluate a string that may contain a reference to an environement variable enclosed by ${...}.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • evaluate

        public static java.lang.String evaluate​(java.lang.String strSource)
        Evaluate a string that may contain a reference to an environement variable enclosed by ${...}
        Parameters:
        strSource - The source string
        Returns:
        The source string or the env variable's value if found.
      • evaluate

        public static java.lang.String evaluate​(java.lang.String strSource,
                                                java.lang.String strEnvPrefix)
        Evaluate a string that may contain a reference to an environement variable enclosed by ${...}. If the environement variable has a suffix _FILE the evaluation will take the content of the file as value.
        Parameters:
        strSource - The source string
        strEnvPrefix - A prefix of the environment
        Returns:
        The source string or the env variable's value if found.