public class ShellExecute
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ShellExecute.ProcessComplete
Event to signify process has completed
|
Constructor and Description |
---|
ShellExecute() |
Modifier and Type | Method and Description |
---|---|
ShellExecute |
addProcessCompleteListener(ShellExecute.ProcessComplete listener)
Add listeners to be notified when the process is complete
|
void |
executeCommand(java.lang.String cmd)
Execute a single commandline string
|
java.lang.String |
getErrorText()
Gets any error text from the process
|
java.lang.String |
getProcessText()
Gets the output of the process
|
boolean |
isAlive()
Test if the process is alive
|
void |
killProcess()
Kill the running process
|
void |
runProcess(java.lang.String... args)
Create a process based on command arguments
|
public ShellExecute addProcessCompleteListener(ShellExecute.ProcessComplete listener)
listener
- the listener to be notified when the process completespublic void killProcess()
public boolean isAlive()
public java.lang.String getProcessText()
public java.lang.String getErrorText()
public void executeCommand(java.lang.String cmd) throws java.io.IOException
cmd
- commandline to executejava.io.IOException
- thrown exception if unable to run commandpublic void runProcess(java.lang.String... args) throws java.io.IOException
args
- the arguments to start processjava.io.IOException
- thrown exception if unable to create the process