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

com.jn.langx.commandline.launcher.CommandLauncherProxy Maven / Gradle / Ivy

Go to download

Java lang extensions for java6+, a supplement to , replacement of a Guava, commons-lang. Core utilities, Collection utilities, IO utilities, Cache, Configuration library ...

There is a newer version: 4.8.2
Show newest version
package com.jn.langx.commandline.launcher;

import com.jn.langx.commandline.CommandLine;
import com.jn.langx.commandline.ProcessAdapter;

import java.io.IOException;
import java.util.Map;


/**
 * A command launcher that proxies another command launcher. Sub-classes
 * override exec(args, env, workdir)
 */
public abstract class CommandLauncherProxy extends LocalCommandLauncher {

    public CommandLauncherProxy(final CommandLauncher launcher) {
        myLauncher = launcher;
    }

    private final CommandLauncher myLauncher;

    /**
     * Launches the given command in a new process. Delegates this method to the
     * proxied launcher
     *
     * @param cmd the command line to execute as an array of strings
     * @param env the environment to set as an array of strings
     * @throws IOException forwarded from the exec method of the command launcher
     */
    @Override
    public ProcessAdapter exec(final CommandLine cmd, final Map env)
            throws IOException {
        return myLauncher.exec(cmd, env);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy