This class represents a system command that is being used by CLI.
Modifiers | Name | Description |
---|---|---|
java.util.ArrayList<java.lang.String> |
args |
Arguments for the program. |
java.lang.String |
program |
Name of the program to run. |
long |
timeout |
Default timeout is set to 300 seconds (5 minutes) |
java.io.File |
workingDirectory |
Working directory for the program. |
Constructor and description |
---|
Command
(java.util.Map<java.lang.String, java.io.Serializable> initArgs) Constructor. |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
addArguments(java.lang.String... newArgs) Adds new arguments to the command. |
|
void |
addArguments(java.util.List<java.lang.String> newArgs) Adds new arguments to the command. |
|
long |
getTimeout() Returns current value for the command timeout |
|
java.lang.ProcessBuilder |
renderCommand() Builds a ProcessBuilder for given program and arguments. |
|
ExecutionResult |
run() Renders a Command to a ProcessBuilder and executes it. |
|
void |
setTimeout(long timeout) Sets new value value for the command timeout |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Arguments for the program.
Name of the program to run.
Default timeout is set to 300 seconds (5 minutes)
Working directory for the program.
Constructor.
initArgs
- Map of the initialization parametersAdds new arguments to the command.
newArgs
- array of argumentsAdds new arguments to the command.
newArgs
- array of arguments in a listReturns current value for the command timeout
Builds a ProcessBuilder for given program and arguments.
Renders a Command to a ProcessBuilder and executes it.
command
- preconfigured Command instanceSets new value value for the command timeout
timeout
- value in millisecondsGroovy Documentation