public interface CommandLineTool
Modifier and Type | Method and Description |
---|---|
<T extends CommandLineToolExecutionHandle> |
execute(CommandLineToolExecutionEngine<T> engine)
Convenience for
newInvocation().build().submit(engine) . |
ProcessBuilderEngine.Handle |
execute(List<?> env,
File workingDirectory)
Convenience for
newInvocation().withEnvironmentVariables(CommandLineToolInvocationEnvironmentVariables.from(env)).workingDirectory(workingDirectory).build().submit(new ProcessBuilderEngine()) . |
static Optional<CommandLineTool> |
fromPath(String executable) |
String |
getExecutable() |
CommandLineToolInvocationBuilder |
newInvocation()
Prepares a new invocation via the
CommandLineToolInvocationBuilder . |
static CommandLineTool |
of(File executable) |
static CommandLineTool |
of(Object executable) |
CommandLine |
withArguments(Iterable<?> arguments)
Creates a command line from this tool and the specified arguments.
|
CommandLine |
withArguments(Object... arguments)
Creates a command line from this tool and the specified arguments.
|
static Optional<CommandLineTool> fromPath(String executable)
static CommandLineTool of(File executable)
static CommandLineTool of(Object executable)
CommandLine withArguments(Object... arguments)
arguments
- the arguments forming a CommandLine
with this tool.CommandLine
instance of this tool with the specified arguments, never null.CommandLine withArguments(Iterable<?> arguments)
arguments
- the arguments forming a CommandLine
with this tool.CommandLine
instance of this tool with the specified arguments, never null.CommandLineToolInvocationBuilder newInvocation()
CommandLineToolInvocationBuilder
.
The invocation is responsible for configuring the working directory, environment variables, standard stream manipulation, etc.CommandLineToolInvocationBuilder
instance, never null.<T extends CommandLineToolExecutionHandle> T execute(CommandLineToolExecutionEngine<T> engine)
newInvocation().build().submit(engine)
.engine
- the executing engine to use, cannot be nullCommandLineToolExecutionHandle
representing the execution in progress, never null.ProcessBuilderEngine.Handle execute(@Nullable List<?> env, File workingDirectory)
newInvocation().withEnvironmentVariables(CommandLineToolInvocationEnvironmentVariables.from(env)).workingDirectory(workingDirectory).build().submit(new ProcessBuilderEngine())
.
This API behave similarly to the Groovy API.env
- the environment variable to invoke the process with, null means inherited.workingDirectory
- the working directory to invoke the process in, null means inherited.ProcessBuilderEngine.Handle
representing the execution in progress, never null.