public class OmeCliCommandRunner
extends java.lang.Object
| Constructor and Description |
|---|
OmeCliCommandRunner(OmeroEnv env,
OmeCliCommandBuilder cmd)
Creates a new instance to run the specified command.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
run()
Runs the command discarding any output.
|
boolean |
run(java.nio.file.Path outputFile)
Runs the command redirecting all output to the specified file.
|
java.util.Optional<java.lang.String> |
runAndCollectOutput()
Runs the command collecting any output in a result string.
|
public OmeCliCommandRunner(OmeroEnv env, OmeCliCommandBuilder cmd)
env - the service environment.cmd - the command to run.java.lang.NullPointerException - if any argument is null.public boolean run(java.nio.file.Path outputFile)
outputFile - where to redirect output.true if the command succeeded, false otherwise.java.lang.NullPointerException - if the argument is null.public boolean run()
true if the command succeeded, false otherwise.public java.util.Optional<java.lang.String> runAndCollectOutput()