if (prop == null) { try {  Method getenv = System.class.getMethod("getenv", new Class[] {String.class}); prop = (String) getenv.invoke(null, new Object[] {var}); } catch (Throwable t) {    } }
	public static String substituteVars(String path) {		StringBuffer buf = new StringBuffer(path.length());		StringTokenizer st = new StringTokenizer(path, VARIABLE_DELIM_STRING, true);		boolean varStarted = false; // indicates we are processing a var subtitute		String var = null; // the current var key		while (st.hasMoreElements()) {			String tok = st.nextToken();			if (VARIABLE_DELIM_STRING.equals(tok)) {				if (!varStarted) {					varStarted = true; // we found the start of a var					var = ""; //$NON-NLS-1$				} else {					// we have found the end of a var					String prop = null;					// get the value of the var from system properties					if (var != null && var.length() > 0)						prop = FrameworkProperties.getProperty(var);					if (prop != null)						// found a value; use it						buf.append(prop);					else						// could not find a value append the var name w/o delims 						buf.append(var == null ? "" : var); //$NON-NLS-1$					varStarted = false;					var = null;				}			} else {				if (!varStarted)					buf.append(tok); // the token is not part of a var				else					var = tok; // the token is the var key; save the key to process when we find the end token			}		}		if (var != null)			// found a case of $var at the end of the path with no trailing $; just append it as is.			buf.append(VARIABLE_DELIM_CHAR).append(var);		return buf.toString();	}