code: private static String replaceEnvVars(final String val) {
          String ret = val;
          final String[] envVars = StringUtils.substringsBetween(ret, "${", "}");
          if (null != envVars) {
              for (int i = 0; i < envVars.length; i++) {
                  final String envKey = envVars[i];
                  String envVal = System.getenv(envKey);
                  if (StringUtils.isBlank(envVal)) {
                      envVal = "";
                  }
  
                  ret = StringUtils.replace(ret, "${" + envKey + "}", envVal);
              }
          }
  
          return ret;
      }
docs: Replaces ${xxx} with corresponding env variable for the specified val.
  
  @param val the specified val
  @return replaced val