本文整理了Java中hudson.Launcher.launch()
方法的一些代码示例,展示了Launcher.launch()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Launcher.launch()
方法的具体详情如下:
包路径:hudson.Launcher
类名称:Launcher
方法名:launch
[英]Launches a process by using a ProcStarter to configure the parameters.
[中]通过使用ProcStarter来配置参数来启动进程。
代码示例来源:origin: jenkinsci/jenkins
/**
* Starts the new process as configured.
*/
public Proc start() throws IOException {
return launch(this);
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public Proc launch(ProcStarter starter) throws IOException {
return inner.launch(starter);
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public Proc launch(String[] cmd, boolean[] mask, String[] env, InputStream in, OutputStream out, FilePath workDir) throws IOException {
return inner.launch(cmd, mask, env, in, out, workDir);
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public Proc launch(String[] cmd, String[] env, InputStream in, OutputStream out, FilePath workDir) throws IOException {
return inner.launch(cmd, env, in, out, workDir);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* @deprecated as of 1.311
* Use {@link #launch()} and its associated builder pattern
*/
@Deprecated
public final Proc launch(String[] cmd, String[] env, OutputStream out, FilePath workDir) throws IOException {
return launch(cmd, env, null, out, workDir);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* @deprecated as of 1.311
* Use {@link #launch()} and its associated builder pattern
*/
@Deprecated
public final Proc launch(String[] cmd, String[] env, InputStream in, OutputStream out) throws IOException {
return launch(cmd, env, in, out, null);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Launch a command with optional censoring of arguments from the listener (Note: <strong>The censored portions will
* remain visible through /proc, pargs, process explorer, etc. i.e. people logged in on the same machine</strong>
* This version of the launch command just ensures that it is not visible from a build log which is exposed via the
* web)
*
* @param cmd The command and all it's arguments.
* @param mask Which of the command and arguments should be masked from the listener
* @param env Environment variable overrides.
* @param in null if there's no input.
* @param out stdout and stderr of the process will be sent to this stream. the stream won't be closed.
* @return The process of the command.
* @throws IOException When there are IO problems.
*
* @deprecated as of 1.311
* Use {@link #launch()} and its associated builder pattern
*/
@Deprecated
public final Proc launch(String[] cmd, boolean[] mask, String[] env, InputStream in, OutputStream out) throws IOException {
return launch(cmd, mask, env, in, out, null);
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public Proc launch(ProcStarter starter) throws IOException {
starter.commands.addAll(0,Arrays.asList(prefix));
boolean[] masks = starter.masks;
if (masks != null) {
starter.masks = prefix(masks);
}
return outer.launch(starter);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* @deprecated as of 1.311
* Use {@link #launch()} and its associated builder pattern
*/
@Deprecated
public final Proc launch(String[] cmd, Map<String, String> env, OutputStream out, FilePath workDir) throws IOException {
return launch(cmd, Util.mapToEnv(env), out, workDir);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* @deprecated as of 1.311
* Use {@link #launch()} and its associated builder pattern
*/
@Deprecated
public final Proc launch(String[] cmd, Map<String, String> env, InputStream in, OutputStream out) throws IOException {
return launch(cmd, Util.mapToEnv(env), in, out);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* @deprecated as of 1.311
* Use {@link #launch()} and its associated builder pattern
*/
@Deprecated
public final Proc launch(String cmd,String[] env,OutputStream out, FilePath workDir) throws IOException {
return launch(Util.tokenize(cmd),env,out,workDir);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* @deprecated as of 1.311
* Use {@link #launch()} and its associated builder pattern
*/
@Deprecated
public final Proc launch(String cmd, Map<String,String> env, OutputStream out, FilePath workDir) throws IOException {
return launch(cmd,Util.mapToEnv(env),out,workDir);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Launch a command with optional censoring of arguments from the listener (Note: <strong>The censored portions will
* remain visible through /proc, pargs, process explorer, etc. i.e. people logged in on the same machine</strong>
* This version of the launch command just ensures that it is not visible from a build log which is exposed via the
* web)
*
* @param cmd The command and all it's arguments.
* @param mask Which of the command and arguments should be masked from the listener
* @param env Environment variable overrides.
* @param in null if there's no input.
* @param out stdout and stderr of the process will be sent to this stream. the stream won't be closed.
* @return The process of the command.
* @throws IOException When there are IO problems.
*
* @deprecated as of 1.311
* Use {@link #launch()} and its associated builder pattern
*/
@Deprecated
public final Proc launch(String[] cmd, boolean[] mask, Map<String, String> env, InputStream in, OutputStream out) throws IOException {
return launch(cmd, mask, Util.mapToEnv(env), in, out);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Launch a command with optional censoring of arguments from the listener (Note: <strong>The censored portions will
* remain visible through /proc, pargs, process explorer, etc. i.e. people logged in on the same machine</strong>
* This version of the launch command just ensures that it is not visible from a build log which is exposed via the
* web)
*
* @param cmd The command and all it's arguments.
* @param mask Which of the command and arguments should be masked from the listener
* @param env Environment variable overrides.
* @param out stdout and stderr of the process will be sent to this stream. the stream won't be closed.
* @param workDir null if the working directory could be anything.
* @return The process of the command.
* @throws IOException When there are IO problems.
*
* @deprecated as of 1.311
* Use {@link #launch()} and its associated builder pattern
*/
@Deprecated
public final Proc launch(String[] cmd, boolean[] mask, Map<String, String> env, OutputStream out, FilePath workDir) throws IOException {
return launch(cmd, mask, Util.mapToEnv(env), out, workDir);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Primarily invoked from {@link ProcStarter#start()} to start a process with a specific launcher.
*/
public abstract Proc launch(@Nonnull ProcStarter starter) throws IOException;
代码示例来源:origin: jenkinsci/jenkins
/**
* @param env
* Environment variable overrides.
* @param in
* null if there's no input.
* @param workDir
* null if the working directory could be anything.
* @param out
* stdout and stderr of the process will be sent to this stream.
* the stream won't be closed.
*
* @deprecated as of 1.311
* Use {@link #launch()} and its associated builder pattern
*/
@Deprecated
public Proc launch(String[] cmd, String[] env, InputStream in, OutputStream out, FilePath workDir) throws IOException {
return launch(launch().cmds(cmd).envs(env).stdin(in).stdout(out).pwd(workDir));
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Fills a {@link ProcStarter} with all the parameters configured by this builder.
*/
public ProcStarter launch(Launcher launcher) {
return launcher.launch().cmds(toFullArguments()).pwd(pwd);
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public Proc launch(ProcStarter starter) throws IOException {
EnvVars e = new EnvVars(env);
if (starter.envs!=null) {
for (String env : starter.envs) {
e.addLine(env);
}
}
starter.envs = Util.mapToEnv(e);
return outer.launch(starter);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Checks if "java" is in PATH on the given node.
*
* <p>
* If it's not, then the user must specify a configured JDK,
* so this is often useful for form field validation.
*/
public static boolean isDefaultJDKValid(Node n) {
try {
TaskListener listener = new StreamTaskListener(new NullStream());
Launcher launcher = n.createLauncher(listener);
return launcher.launch().cmds("java","-fullversion").stdout(listener).join()==0;
} catch (IOException e) {
return false;
} catch (InterruptedException e) {
return false;
}
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException {
FilePath dir = preferredLocation(tool, node);
// TODO support Unix scripts with interpreter line (see Shell.buildCommandLine)
FilePath script = dir.createTextTempFile("hudson", getCommandFileExtension(), command);
try {
String cmd[] = getCommandCall(script);
int r = node.createLauncher(log).launch().cmds(cmd).stdout(log).pwd(dir).join();
if (r != 0) {
throw new IOException("Command returned status " + r);
}
} finally {
script.delete();
}
return dir.child(getToolHome());
}
内容来源于网络,如有侵权,请联系作者删除!