bb.util
Class OsUtil.ExecTask
java.lang.Object
bb.util.OsUtil.ExecTask
- All Implemented Interfaces:
- Runnable
- Enclosing class:
- OsUtil
private static class OsUtil.ExecTask
- extends Object
- implements Runnable
Encapsulates all the work carried out by both the execSynch and execAsynch methods.
This class is not multithread safe: it expects to be called by the same thread over its entire life.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
command
private final String command
envp
private final String[] envp
dir
private final File dir
outDrainer
private final StreamDrainer outDrainer
errDrainer
private final StreamDrainer errDrainer
stdOut
private byte[] stdOut
errors
private String errors
OsUtil.ExecTask
private OsUtil.ExecTask(String command,
String[] envp,
File dir,
StreamDrainer outDrainer,
StreamDrainer errDrainer)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
run
public void run()
- Specified by:
run
in interface Runnable
getStdOut
private byte[] getStdOut()
getState
private String getState()
formatMsg
private String formatMsg(String label,
String msg)
needsLineEnd
private String needsLineEnd(String msg)
- Returns a newline if msg does not end in one, otherwise returns blank.