|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectprotoj.lang.internal.ant.CommandTask
public final class CommandTask
A convenience class for executing a system command. Use the constructors to
specify the minimal and most widely anticipated configuration and the
initXXX methods for the less common configuration options.
As far as possible this class is used to hide the differences in syntax between different operating systems.
| Constructor Summary | |
|---|---|
CommandTask(java.io.File dir,
java.lang.String executable,
java.lang.String argLine)
Accepts the details of the system command that should be executed. |
|
| Method Summary | |
|---|---|
void |
execute()
|
java.lang.String |
getResult()
|
java.lang.String |
getStderr()
|
java.lang.String |
getStdout()
|
void |
initSpawn(boolean spawn)
|
boolean |
isSuccess()
It only makes sense to call this method from a forked but non-spawned vm. |
boolean |
isWindows()
Helper for CommandTask(java.io.File, java.lang.String, java.lang.String) for determining if the current OS is
windows. |
void |
writeOutput()
All the output from the executed command seems to get buffered.command has exited, the buffered output can be written using this method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandTask(java.io.File dir,
java.lang.String executable,
java.lang.String argLine)
cmd.exe.
dir - the directory in which the command should be executedexecutable - the command to execute without any command line argumentsargLine - a space-delimited list of command-line arguments.| Method Detail |
|---|
public void initSpawn(boolean spawn)
public boolean isWindows()
CommandTask(java.io.File, java.lang.String, java.lang.String) for determining if the current OS is
windows.
public void execute()
public java.lang.String getStdout()
public java.lang.String getStderr()
public java.lang.String getResult()
public void writeOutput()
public boolean isSuccess()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||