public class ProcessExecutor extends Object
| Constructor and Description |
|---|
ProcessExecutor(File workingDir,
org.apache.commons.exec.CommandLine cmdLine)
Constructs new
ProcessExecutor instance. |
ProcessExecutor(File workingDir,
org.apache.commons.exec.CommandLine cmdLine,
Map<String,String> env,
List<String> paths)
Constructs new
ProcessExecutor instance. |
| Modifier and Type | Method and Description |
|---|---|
int |
execute(OutputStream outputStream,
OutputStream errOutputStream,
CdsMojoLogger logger) |
String |
executeAndGetResult(CdsMojoLogger logger)
Executes the process.
|
void |
setExitValues(int[] exitValues) |
public ProcessExecutor(File workingDir, org.apache.commons.exec.CommandLine cmdLine)
ProcessExecutor instance.workingDir - the working directory of the process to runcmdLine - the command line to executepublic ProcessExecutor(File workingDir, org.apache.commons.exec.CommandLine cmdLine, Map<String,String> env, List<String> paths)
ProcessExecutor instance.workingDir - the working directory of the process to runcmdLine - the command line to executeenv - additional environment variablespaths - a list of directories that will be added to path env. variablepublic int execute(OutputStream outputStream, OutputStream errOutputStream, CdsMojoLogger logger) throws IOException
outputStream - the output stream to write console output toerrOutputStream - the error output streamlogger - a required CdsMojoLoggerIOException - if execution failedorg.apache.commons.exec.ExecuteException - execution of subprocess failed or the subprocess returned an exit value indicating a
failure Executor.setExitValue(int).public String executeAndGetResult(CdsMojoLogger logger) throws IOException
logger - a required CdsMojoLoggerIOException - if process execution failedorg.apache.commons.exec.ExecuteException - execution of subprocess failed or the subprocess returned an exit value indicating a
failure Executor.setExitValue(int).public void setExitValues(int[] exitValues)
Copyright © 2023. All rights reserved.