Constructor and Description |
---|
Executor()
Default constructor.
|
Executor(String inCommand)
Constructor specifying the command to execute.
|
Executor(String[] inCommand)
Constructor specifying the command to execute.
|
Modifier and Type | Method and Description |
---|---|
void |
addEnvVar(String inName,
String inValue)
Adds the specified environment variable to the list to be set when executing
the command.
|
void |
clearEnvVars()
Clears the list of environment variables to be set when executing the command.
|
int |
exec()
Executes the command.
|
String |
getCommand()
Returns the command to execute.
|
long |
getExecutionTimeMillis()
Returns the execution time in milliseconds of executed command.
|
File |
getShell()
Returns the shell to be used for command execution.
|
String |
getSTDERR()
Returns the STDERR output produced by the executed command.
|
String |
getSTDOUT()
Returns the STDOUT output produced by the executed command.
|
File |
getWorkingDir()
Returns the working directory for command execution.
|
void |
setCommand(String inCommand)
Sets the command to execute.
|
void |
setShell(File inValue)
Sets the shell to be used for command execution.
|
void |
setSTDIN(InputStream inValue)
Sets the STDIN content for the command to be executed.
|
void |
setSTDIN(String inValue)
Sets the STDIN content for the command to be executed.
|
void |
setWorkingDir(File inValue)
Sets the working directory for command execution.
|
public Executor()
public void setCommand(String inCommand)
public String getCommand()
public void clearEnvVars()
public void addEnvVar(String inName, String inValue)
public void setShell(File inValue)
public void setWorkingDir(File inValue)
public File getWorkingDir()
public void setSTDIN(String inValue)
public void setSTDIN(InputStream inValue)
public long getExecutionTimeMillis()
public int exec() throws ExecutorException
ExecutorException