public interface CommandLine
newInvocation()
execute(CommandLineToolExecutionEngine)
Modifier and Type | Method and Description |
---|---|
ProcessBuilderEngine.Handle |
execute() |
<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()) . |
CommandLineToolArguments |
getArguments()
Returns the arguments of the current command line.
|
CommandLineTool |
getTool()
Returns the tool of the current command line.
|
CommandLineToolInvocationBuilder |
newInvocation()
Prepares a new invocation via the
CommandLineToolInvocationBuilder . |
static CommandLine |
of(@NonNull List<?> commandLine)
Creates a
CommandLine instance from the command line elements specified. |
static CommandLine |
of(Object... commandLine)
Creates a
CommandLine instance from the command line elements specified. |
static CommandLine |
script(Object... commandLine)
Creates a
CommandLine instance using the scripting environment to execute the specified command line. |
CommandLineTool getTool()
CommandLineTool
instance representing the tool to execute, never null.CommandLineToolArguments getArguments()
CommandLineToolArguments
instance representing all the 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.ProcessBuilderEngine.Handle execute()
static CommandLine of(Object... commandLine)
CommandLine
instance from the command line elements specified.commandLine
- the command line elements, cannot be empty or contains null values.CommandLine
instance representing the specified command line, never null.static CommandLine of(@NonNull @NonNull List<?> commandLine)
CommandLine
instance from the command line elements specified.commandLine
- the command line elements, cannot be empty or contains null values.CommandLine
instance representing the specified command line, never null.static CommandLine script(Object... commandLine)
CommandLine
instance using the scripting environment to execute the specified command line.
The scripting environment will be cmd /c on Windows or bash -c on *nix.commandLine
- the command line elements, cannot be empty or contains null values.CommandLine
instance representing the specified command line executing in the scripting environment, never null.