public final class ProcessUtil
extends java.lang.Object
Process-related utility methods.| Modifier and Type | Method and Description |
|---|---|
static boolean |
execute(java.util.List<java.lang.String> command,
java.io.File workingDirectory,
java.io.InputStream stdin,
boolean closeStdin,
java.io.OutputStream stdout,
boolean closeStdout,
java.io.OutputStream stderr,
boolean closeStderr)
Executes the given
command and waits until it completes. |
public static boolean execute(java.util.List<java.lang.String> command,
@Nullable
java.io.File workingDirectory,
java.io.InputStream stdin,
boolean closeStdin,
java.io.OutputStream stdout,
boolean closeStdout,
java.io.OutputStream stderr,
boolean closeStderr)
throws java.io.IOException,
java.lang.InterruptedException
command and waits until it completes.workingDirectory - See ProcessBuilder.directory(File)stdin - Where the command's standard input is read fromcloseStdin - Whether stdin should be closedstdout - Where the command's standard output is written tocloseStdout - Whether stdout should be closedstderr - Where the command's standard error is written tocloseStderr - Whether stderr should be closedcommand terminated with exit status zero (i.e. success)java.io.IOExceptionjava.lang.InterruptedException