Managed Process Builder
Builder for ManagedProcess.
This is inspired by java.lang.ProcessBuilder&CommandLine, and/but:
It offers to add java.nio.Path arguments, and makes sure that their absolute path is used.
If no directory is set, it automatically sets the initial working directory using the directory of executable if it was a Path, and thus makes sure an initial working directory is always passed to the process.
It intentionally doesn't offer "parsing" space delimited command "lines", but forces you to set an executable and add arguments.
Author
Michael Vorburger
Neelesh Shastry
William Dutton
Constructors
Functions
Link copied to clipboard
Adds an argument to the command.
Adds a Path as an argument to the command.
Adds a raw argument to the command.
Adds a single argument to the command, composed of two parts.
Link copied to clipboard
Adds a single argument to the command, composed of a prefix and a file path separated by
"=".Link copied to clipboard
Adds an extra stream to receive STDERR from the process.
Link copied to clipboard
Adds an extra stream to receive STDOUT from the process.
Link copied to clipboard
Builds a ManagedProcess from the current configuration.
Link copied to clipboard
Returns the current list of arguments (after quoting/escaping).
Link copied to clipboard
Returns the number of console lines retained for diagnostics.
Link copied to clipboard
Returns the environment variables that will be passed to the launched process.
Link copied to clipboard
Returns the executable path string that will be launched.
Link copied to clipboard
Returns the dispatcher that determines the SLF4J log level (or suppression) for each STDOUT/STDERR line.
Link copied to clipboard
Returns the currently configured process listener.
Link copied to clipboard
Returns the working directory that will be used for the launched process.
Link copied to clipboard
Returns whether the process will be destroyed automatically on JVM shutdown.
Link copied to clipboard
Sets the number of console lines to retain for diagnostics.
Link copied to clipboard
Enables or disables destroying the process when the JVM shuts down.
Link copied to clipboard
Provides an input stream which will be fed to the process' STDIN.
Link copied to clipboard
Sets the predicate that determines whether an exit value is considered success.
Link copied to clipboard
public ManagedProcessBuilder setOutputStreamLogDispatcher(OutputStreamLogDispatcher outputStreamLogDispatcher)
Sets the dispatcher that determines the SLF4J log level (or suppression) for each line emitted on STDOUT/STDERR by the managed process.
Link copied to clipboard
public ManagedProcessBuilder setProcessListener(@Nullable() @Nullable() ManagedProcessListener listener)
Sets the process listener to be notified of lifecycle events.
Link copied to clipboard
Sets working directory.