Here you can find the source of extractValue(String var)
Parameter | Description |
---|---|
var | name of var enclosed by ${ and } |
public static String extractValue(String var)
//package com.java2s; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Main { static final Logger LOGGER = LoggerFactory .getLogger("com.force.sdk.connector"); /**//from www. j a va 2 s . c om * This method will fetch and return the value of 'var' from system variables and if not found in system variables * then in environment variables. * @param var name of var enclosed by ${ and } * @return value of var */ public static String extractValue(String var) { if (var != null) { if (!var.startsWith("${") || !var.endsWith("}")) { return null; } var = var.replace("${", ""); var = var.substring(0, var.length() - 1); if (var != null) { if (System.getProperty(var) != null) { LOGGER.info("Connection : loading " + var + " from Java System Properties"); return System.getProperty(var); } if (System.getenv(var) != null) { LOGGER.info("Connection : loading " + var + " from Environment Variables"); return System.getenv(var); } } } return null; } }