org.enhydra.xml.xmlc.misc
Class ProcessRunner
java.lang.Object
|
+--org.enhydra.xml.xmlc.misc.ProcessRunner
- Direct Known Subclasses:
- JavaCompile
- public class ProcessRunner
- extends Object
Run a process, optionally collecting stdout/stderr.
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PASS_STDOUT
public static final int PASS_STDOUT
- Options to enable passing or collecting of output.
PASS_STDERR
public static final int PASS_STDERR
COLLECT_STDOUT
public static final int COLLECT_STDOUT
COLLECT_STDERR
public static final int COLLECT_STDERR
STDERR_TO_REPORTER
public static final int STDERR_TO_REPORTER
DUMP_STDERR_ON_FAIL
public static final int DUMP_STDERR_ON_FAIL
NO_EXCEPTION_ON_ERR_EXIT
public static final int NO_EXCEPTION_ON_ERR_EXIT
exitCode
int exitCode
- Exit code of last process.
ProcessRunner
public ProcessRunner(int opts)
- Constructor.
setOptions
public void setOptions(int opts)
- Set the options
getOptions
public int getOptions()
- Get the options
getExitCode
public int getExitCode()
run
public void run(String[] cmd,
ErrorReporter errorReporter,
PrintWriter verboseOut,
String failMsg)
throws XMLCException
- Run a process. Stdout/stderr are optionally copied to the standard
descriptors and/or collected.
- Parameters:
cmd
- Program to run and arguments.verboseOut
- Write verbose message to this file if not null.failMsg
- Message to use in exception if process fails.
getStdout
public String getStdout()
- Get accumulated stdout, or null if it was not collected.
getStderr
public String getStderr()
- Get accumulated stderr, or null if it was not collected.
Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.