01: package dalma.webui;
02:
03: import org.apache.tools.ant.taskdefs.Execute;
04:
05: import java.util.Collections;
06: import java.util.HashMap;
07: import java.util.Map;
08: import java.util.Vector;
09:
10: /**
11: * Access to the environmental variables.
12: *
13: * @author Kohsuke Kawaguchi
14: */
15: class EnvVars {
16: /**
17: * Environmental variables that we've inherited.
18: */
19: public static final Map<String, String> masterEnvVars;
20:
21: static {
22: Vector<String> envs = Execute.getProcEnvironment();
23: Map<String, String> m = new HashMap<String, String>();
24: for (String e : envs) {
25: int idx = e.indexOf('=');
26: m.put(e.substring(0, idx), e.substring(idx + 1));
27: }
28: masterEnvVars = Collections.unmodifiableMap(m);
29: }
30:
31: }
|