Package scriptella.driver.shell
Class ShellCommandRunner
java.lang.Object
scriptella.driver.shell.ShellCommandRunner
Runner for shell commands, abstracting threading and process details.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidprotected voidexecAndInitReaders(String[] args) Can be subclassed for testing and no use Process at all.voidexecuteAfterStdoutStderrConsumed(Runnable runnable) voidWait for the process to finish (including stdout/stderr finished forwarding) and check for errors during processing its outputprotected void
-
Field Details
-
procOutputReader
-
procErrReader
-
-
Constructor Details
-
ShellCommandRunner
-
-
Method Details
-
exec
- Throws:
IOException
-
waitForAndCheckExceptions
Wait for the process to finish (including stdout/stderr finished forwarding) and check for errors during processing its output- Throws:
InterruptedException- if the current thread is interrupted while waitingExecutionException- if an error occurred during processing output of the process (srdin/stderr)
-
executeAfterStdoutStderrConsumed
-
close
public void close() -
execAndInitReaders
Can be subclassed for testing and no use Process at all.- Throws:
IOException
-
waitForProc
- Throws:
InterruptedException
-