| java.lang.Object org.antmod.util.ProcessLauncher
ProcessLauncher | final public class ProcessLauncher (Code) | | Launches a process, redirecting the output of that sub-process
to the output of this (the parent) process.
author: Klaas Waslander |
Inner Class :public interface OutputListener | |
Inner Class :public static class CommandNotExistsException extends RuntimeException | |
Method Summary | |
public void | abort() Tries to abort the currently running process. | public void | addOutputListener(OutputListener listener) Add a listener for output from the to-be-launched process. | public String | getCommandLine() Get the commandline that is used to launch the process. | public String | getErrorOutput() Get error output, in case no listeners were registered - never returns null. | public String | getStandardOutput() Get standard output, in case no listeners were registered - never returns null. | public boolean | hasFinished() Check whether execution has finished. | public int | launch() Launches the process, and blocks until that process completes execution. |
ProcessLauncher | public ProcessLauncher(String commandLine)(Code) | | Constructs new process launcher with the given command line.
|
ProcessLauncher | public ProcessLauncher(String[] commandArray)(Code) | | Constructs new process launcher with the given command array.
|
ProcessLauncher | public ProcessLauncher(String[] commandArray, File baseDir)(Code) | | |
ProcessLauncher | public ProcessLauncher(ArrayList commandList)(Code) | | Constructs new process launcher with the given command element list.
|
abort | public void abort()(Code) | | Tries to abort the currently running process.
|
addOutputListener | public void addOutputListener(OutputListener listener)(Code) | | Add a listener for output from the to-be-launched process.
|
getCommandLine | public String getCommandLine()(Code) | | Get the commandline that is used to launch the process.
|
getErrorOutput | public String getErrorOutput()(Code) | | Get error output, in case no listeners were registered - never returns null.
|
getStandardOutput | public String getStandardOutput()(Code) | | Get standard output, in case no listeners were registered - never returns null.
|
hasFinished | public boolean hasFinished()(Code) | | Check whether execution has finished.
|
launch | public int launch() throws CommandNotExistsException(Code) | | Launches the process, and blocks until that process completes execution.
throws: CommandNotExistsException - If the command could not be executed because it does not exist |
|
|