public class RunCommand
extends java.lang.Object
run(List, Path, long)
method to run a command in a separate process
with a timeout.Modifier and Type | Class and Description |
---|---|
static class |
RunCommand.CommandException
Exception representing an error that occured while running a process with
run(List, Path, long) . |
static class |
RunCommand.Status
Represents the status of a process that has been executed.
|
Constructor and Description |
---|
RunCommand() |
Modifier and Type | Method and Description |
---|---|
(package private) static RunCommand.Status |
run(java.util.List<java.lang.String> command,
java.nio.file.Path workingDirectory,
long timeoutMillis)
Runs the given command synchronously in the given directory using the given timeout.
|
static RunCommand.Status run(java.util.List<java.lang.String> command, java.nio.file.Path workingDirectory, long timeoutMillis) throws RunCommand.CommandException
RunCommand.Status
object capturing the command, exit status,
and output from the process.command
- the command to be run in the processworkingDirectory
- the working directory for the commandtimeoutMillis
- the timeout in milliseconds for executing the processRunCommand.Status
capturing the outcome of executing the commandRunCommand.CommandException
- if there is an error running the command