All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hudson.EnvVars Maven / Gradle / Ivy

package hudson;

import org.apache.tools.ant.taskdefs.Execute;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;

/**
 * @author Kohsuke Kawaguchi
 */
public class EnvVars {
    /**
     * Environmental variables that we've inherited.
     */
    public static final Map masterEnvVars;

    static {
        @SuppressWarnings("unchecked") // Ant does not use JDK 5
        Vector envs = Execute.getProcEnvironment();
        Map m = new HashMap();
        for (String e : envs) {
            int idx = e.indexOf('=');
            m.put(e.substring(0, idx), e.substring(idx + 1));
        }
        masterEnvVars = Collections.unmodifiableMap(m);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy