|
|||||||||||
| 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(Process p)
This method starts two background threads that read the input and error streams of the Process object. |
int |
exec(String command)
Execute command and wait for termination. |
int |
exec(String[] cmdargs)
Execute command and wait for termination. |
boolean |
failed()
Returns true if there was an error executing the last process |
Exception |
getError()
Returns the error object from the last execution. |
String |
getErrorBuffer()
Returns the standard error from the process as a string. |
int |
getExitValue()
Returns the exit code for the last completed process. |
String |
getOutputBuffer()
Returns the standard output from the process as a string. |
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(String command)
command - The command to execute
public int exec(String[] cmdargs)
cmdargs - The command (first item) and its arguments
public int exec(Process p)
p - The executing process
public Process getProcess()
public int getExitValue()
public boolean failed()
public String getOutputBuffer()
public String getErrorBuffer()
public Exception getError()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||