@ThreadSafe public interface ProcessExecutor
DefaultProcessExecutor
Modifier and Type | Interface and Description |
---|---|
static interface |
ProcessExecutor.ConsoleOutput
This interface provides operations that can be performed on the stdout or stderr consoles attached to the
external process.
|
Modifier and Type | Method and Description |
---|---|
ProcessExecutor.ConsoleOutput |
getStderr()
Returns the stderr console.
|
ProcessExecutor.ConsoleOutput |
getStdout()
Returns the stdout console.
|
ProcessExecutor |
send(String string)
Sends a string to the stdin of the running process.
|
ProcessExecutor |
start()
Starts the external process.
|
void |
stop()
Stops the external process.
|
ProcessExecutor |
waitForCompletion()
Waits for the termination of the external process.
|
ProcessExecutor |
withArgument(String argument)
Adds a single argument to pass to the external process.
|
ProcessExecutor |
withArguments(String... arguments)
Adds some arguments to pass to the external process.
|
@Nonnull ProcessExecutor withArguments(@Nonnull String... arguments)
arguments
- the arguments@Nonnull ProcessExecutor withArgument(@Nonnull String argument)
argument
- the argument@Nonnull ProcessExecutor start() throws IOException
IOException
- in case of errorvoid stop()
@Nonnull ProcessExecutor waitForCompletion() throws IOException, InterruptedException
InterruptedException
- if the wait has been interruptedIOException
- in case of I/O error@Nonnull ProcessExecutor send(@Nonnull String string) throws IOException
string
- the string to sendIOException
- in case of I/O error@Nonnull ProcessExecutor.ConsoleOutput getStdout()
@Nonnull ProcessExecutor.ConsoleOutput getStderr()
Copyright © 2009–2016 Tidalwave s.a.s. (http://tidalwave.it). All rights reserved.