public interface CommandExecutor
Modifier and Type | Interface and Description |
---|---|
static interface |
CommandExecutor.ErrorListener |
static class |
CommandExecutor.Factory
Provides factory services for creating a default instance of the command executor.
|
Modifier and Type | Method and Description |
---|---|
void |
addEnvironment(String name,
String value)
Adds an environment variable with the specified name and value to the executor.
|
void |
executeCommand(String executable,
List<String> commands)
Executes the command for the specified executable and list of command options.
|
void |
executeCommand(String executable,
List<String> commands,
boolean failsOnErrorOutput)
Executes the command for the specified executable and list of command options.
|
void |
executeCommand(String executable,
List<String> commands,
File workingDirectory,
boolean failsOnErrorOutput)
Executes the command for the specified executable and list of command options.
|
long |
getPid() |
int |
getResult()
Returns the process result of executing the command.
|
String |
getStandardError()
Returns the standard error from executing the command.
|
String |
getStandardOut()
Returns the standard output from executing the command.
|
void |
setCaptureStdErr(boolean captureStdErr) |
void |
setCaptureStdOut(boolean captureStdOut) |
void |
setCustomShell(org.codehaus.plexus.util.cli.shell.Shell s) |
void |
setErrorListener(CommandExecutor.ErrorListener errorListener) |
void |
setLogger(org.apache.maven.plugin.logging.Log logger)
Sets the plexus logger.
|
void setLogger(org.apache.maven.plugin.logging.Log logger)
logger
- the plexus loggervoid executeCommand(String executable, List<String> commands) throws ExecutionException
executable
- the name of the executable (csc, xsd, etc).commands
- the command options for the compiler/executableExecutionException
- if compiler or executable writes anything to the standard error stream or if the process returns a
process result != 0.void executeCommand(String executable, List<String> commands, boolean failsOnErrorOutput) throws ExecutionException
executable
- the name of the executable (csc, xsd, etc).commands
- the commands options for the compiler/executablefailsOnErrorOutput
- if true, throws an ExecutionException
if there the compiler or executable writes anything
to the error output stream. By default, this value is trueExecutionException
- if compiler or executable writes anything to the standard error stream (provided the
failsOnErrorOutput is not false) or if the process returns a process result != 0.void executeCommand(String executable, List<String> commands, File workingDirectory, boolean failsOnErrorOutput) throws ExecutionException
executable
- the name of the executable (csc, xsd, etc).commands
- the command options for the compiler/executableworkingDirectory
- the directory where the command will be executedExecutionException
- if compiler or executable writes anything to the standard error stream (provided the
failsOnErrorOutput is not false) or if the process returns a process result != 0.int getResult()
long getPid()
String getStandardOut()
String getStandardError()
void addEnvironment(String name, String value)
void setErrorListener(CommandExecutor.ErrorListener errorListener)
void setCustomShell(org.codehaus.plexus.util.cli.shell.Shell s)
void setCaptureStdOut(boolean captureStdOut)
void setCaptureStdErr(boolean captureStdErr)
Copyright © 2014–2016 simpligility technologies inc.. All rights reserved.