|
terp - the Codemesh Modular Template Interpreter v1.2.229 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.codemesh.terp.eval.executors.ProcessExecutor.Result
public static class ProcessExecutor.Result
The result of any ProcessExecutor invocation. This type wraps all outcomes of a process invocation. You have access to the exitCode, the stdout and stderr outputs in line and raw form, and a potssibly thrown exception.
When executing in the context of ANT, you usually use instances of this type in <terp.fail> or <terp.property> tasks after a <terp.exec>. The <terp.exec> sets an instance of this type into a result property and you can then query its members for additional information.
Example
In the following example, the listing output will be available in the 'listing' property together with all other information about the result of the shell command execution.
<terp.exec expression="^shell()('ls -la .')"
result="listing"
failonerror="false"
if="os.family!='windows'"
/>
<terp.property name="output" expression="listing.outraw" />
| Constructor Summary | |
|---|---|
ProcessExecutor.Result(java.io.OutputStream os,
java.io.OutputStream es,
java.lang.Throwable t,
int exitCode)
|
|
| Method Summary | |
|---|---|
java.lang.String[] |
getErr()
Returns the output written by the process to stderr as an array of lines without eols. |
java.lang.String |
getErrRaw()
Returns the output written by the process to stderr as one string. |
java.lang.Throwable |
getException()
Returns the exception thrown by the Java process APIs or null if no exception was thrown. |
int |
getExitCode()
Returns the process' exit code. |
java.lang.String[] |
getOut()
Returns the output written by the process to stdout as an array of lines without eols. |
java.lang.String |
getOutRaw()
Returns the output written by the process to stdout as one string. |
java.lang.String |
toString()
Returns a string representation of the entire ProcessResult instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ProcessExecutor.Result(java.io.OutputStream os,
java.io.OutputStream es,
java.lang.Throwable t,
int exitCode)
| Method Detail |
|---|
public int getExitCode()
public java.lang.Throwable getException()
public java.lang.String getOutRaw()
public java.lang.String[] getOut()
public java.lang.String getErrRaw()
public java.lang.String[] getErr()
public java.lang.String toString()
toString in class java.lang.Object
|
terp - the Codemesh Modular Template Interpreter v1.2.229 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||