@Override public String resolve() { return IoHelper.getenv(variable); }
@Override public String resolve(VariableSubstitutor... substitutors) throws Exception { String _variable_ = variable; for (VariableSubstitutor substitutor : substitutors) { _variable_ = substitutor.substitute(_variable_); } return IoHelper.getenv(_variable_); }
/** * Get the default path for Windows (i.e Program Files/...). * Windows has a Setting for this in the environment and in the registry. * Just try to use the setting in the environment. If it fails for whatever reason, we take the former solution (buildWindowsDefaultPathFromProps). * * @param resources the resources * @return The Windows default installation path for applications. */ private String buildWindowsDefaultPath(Resources resources) { try { //get value from environment... String prgFilesPath = IoHelper.getenv("ProgramFiles"); if (prgFilesPath != null && prgFilesPath.length() > 0) { return prgFilesPath + File.separatorChar; } else { return buildWindowsDefaultPathFromProps(resources); } } catch (Exception exception) { logger.log(Level.WARNING, exception.getMessage(), exception); return buildWindowsDefaultPathFromProps(resources); } }
&& (name.lastIndexOf(']') == name.length() - 1)) varValue = IoHelper.getenv(name.substring(4, name.length() - 1)); if (varValue == null)