|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.function.ExecuteCommand
public class ExecuteCommand
This class is a helper class used to execute operating system commands. This class is used by the UserFunctions class, which provides helper functions through scripting to TDI users.
Nested Class Summary | |
---|---|
static class |
ExecuteCommand.StreamReader
Local thread that reads an input stream and buffers the stream in a string buffer. |
Constructor Summary | |
---|---|
ExecuteCommand()
Constructor for the ExecuteCommand object |
Method Summary | |
---|---|
int |
exec(java.lang.Process p)
This method starts two background threads that read the input and error streams of the Process object. |
int |
exec(java.lang.String command)
Execute command and wait for termination. |
int |
exec(java.lang.String[] cmdargs)
Execute command and wait for termination. |
boolean |
failed()
Returns true if there was an error executing the last process |
java.lang.Exception |
getError()
Returns the error object from the last execution. |
java.lang.String |
getErrorBuffer()
Returns the standard error from the process as a string. |
int |
getExitValue()
Returns the exit code for the last completed process. |
java.lang.String |
getOutputBuffer()
Returns the standard output from the process as a string. |
java.lang.Process |
getProcess()
Returns the Process object of the current/last active process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExecuteCommand()
Method Detail |
---|
public int exec(java.lang.String command)
command
- The command to execute
public int exec(java.lang.String[] cmdargs)
cmdargs
- The command (first item) and its arguments
public int exec(java.lang.Process p)
p
- The executing process
public java.lang.Process getProcess()
public int getExitValue()
public boolean failed()
public java.lang.String getOutputBuffer()
public java.lang.String getErrorBuffer()
public java.lang.Exception getError()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |