public class ShellCommandRunner
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.io.BufferedReader |
procErrReader |
protected java.io.BufferedReader |
procOutputReader |
| Constructor and Description |
|---|
ShellCommandRunner(java.lang.String[] shellCmdArgs,
java.io.BufferedWriter out) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
exec(java.lang.String cmdText) |
protected void |
execAndInitReaders(java.lang.String[] args)
Can be subclassed for testing and no use Process at all.
|
void |
executeAfterStdoutStderrConsumed(java.lang.Runnable runnable) |
void |
waitForAndCheckExceptions()
Wait for the process to finish (including stdout/stderr finished forwarding) and check for errors during processing its output
|
protected void |
waitForProc() |
protected java.io.BufferedReader procOutputReader
protected java.io.BufferedReader procErrReader
public ShellCommandRunner(java.lang.String[] shellCmdArgs,
java.io.BufferedWriter out)
public void exec(java.lang.String cmdText)
throws java.io.IOException
java.io.IOExceptionpublic void waitForAndCheckExceptions()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
java.lang.InterruptedException - if the current thread is interrupted while waitingjava.util.concurrent.ExecutionException - if an error occurred during processing output of the process (srdin/stderr)public void executeAfterStdoutStderrConsumed(java.lang.Runnable runnable)
public void close()
protected void execAndInitReaders(java.lang.String[] args)
throws java.io.IOException
java.io.IOExceptionprotected void waitForProc()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionCopyright © Copyright 2006-2019 The Scriptella Project Team.