|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.platform.ProcessLauncher
public final class ProcessLauncher
Launches a process, redirecting the output of that sub-process to the output of this (the parent) process.
| Nested Class Summary | |
|---|---|
static class |
ProcessLauncher.CommandNotExistsException
Exception that is thrown when a command could not be executed because it (probably) does not exist at all. |
static interface |
ProcessLauncher.OutputListener
Classes implementing this interface can receive output generated by processes launched using the ProcessLauncher. |
| Constructor Summary | |
|---|---|
ProcessLauncher(ArrayList<?> commandList)
Constructs new process launcher with the given command element list. |
|
ProcessLauncher(ArrayList<?> commandList,
File baseDir)
|
|
ProcessLauncher(String commandLine)
Constructs a new ProcessLauncher with the given command line. |
|
ProcessLauncher(String[] commandArray)
Constructs a new ProcessLauncher with the given command array. |
|
ProcessLauncher(String[] commandArray,
File baseDir)
|
|
ProcessLauncher(String commandLine,
File baseDir)
|
|
| Method Summary | |
|---|---|
void |
abort()
Tries to abort the currently running process. |
void |
addOutputListener(ProcessLauncher.OutputListener listener)
Add a listener for output from the to-be-launched process. |
String |
getCommandLine()
Get the commandline that is used to launch the process. |
String |
getErrorOutput()
Get error output, in case no listeners were registered - never returns null. |
String |
getStandardOutput()
Get standard output, in case no listeners were registered - never returns null. |
boolean |
hasFinished()
Check whether execution has finished. |
int |
launch()
Launches the process, and blocks until that process completes execution. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProcessLauncher(String commandLine)
public ProcessLauncher(String commandLine,
File baseDir)
public ProcessLauncher(String[] commandArray)
public ProcessLauncher(String[] commandArray,
File baseDir)
public ProcessLauncher(ArrayList<?> commandList)
public ProcessLauncher(ArrayList<?> commandList,
File baseDir)
| Method Detail |
|---|
public void addOutputListener(ProcessLauncher.OutputListener listener)
public String getStandardOutput()
public String getErrorOutput()
public String getCommandLine()
public boolean hasFinished()
public int launch()
throws ProcessLauncher.CommandNotExistsException
ProcessLauncher.CommandNotExistsException - If the command could not be executed because it does not existpublic void abort()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||