|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.util.Execute
public class Execute
The Execute
class executes external programs.
Constructor Summary | |
---|---|
Execute()
|
Method Summary | |
---|---|
void |
addListener(IExecuteListener pListener)
Adds an execution listener. |
void |
addParameter(String pParam)
Adds a launch parameter. |
void |
destroy()
Destroyes the current process. |
boolean |
execute(boolean pWait)
Launches the given command in a new process. |
int |
getBufferCharacterCount()
Gets the output buffer character count (default: 4000). |
String |
getError()
Gets the data of error stream from last exection. |
PrintStream |
getErrorForwarder()
Gets the forwarder for error messages. |
String |
getOutput()
Gets the data of output stream from last exection. |
PrintStream |
getOutputForwarder()
Gets the forwarder for standard output. |
String |
getProgram()
Gets the program to launch. |
File |
getWorkingDirectory()
Gets the working directory, if set. |
boolean |
isParamsLogEnabled()
Gets whether parameter logging is enabled. |
boolean |
isRunning()
Gets whether the program is still running. |
void |
removeListener(IExecuteListener pListener)
Removes an execution listener. |
void |
send(byte[] pData)
Sends the given data to the executed program. |
void |
setBufferCharacterCount(int pCharCount)
Sets the output buffer character count. |
void |
setErrorForwarder(PrintStream pError)
Sets the forwarder for error messages. |
void |
setOutputForwarder(PrintStream pOutput)
Sets the forwarder for standard output. |
void |
setParamsLogEnabled(boolean pLog)
Sets that parameter logging should be en- or disabled. |
void |
setProgram(String pProgram)
Sets the program to launch. |
void |
setWorkingDirectory(File pWorkDir)
Sets the working directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Execute()
Method Detail |
---|
public void setProgram(String pProgram)
pProgram
- program pathpublic String getProgram()
public void addParameter(String pParam)
pParam
- parameterpublic boolean execute(boolean pWait) throws Exception
pWait
- true
to wait until process is finished, false
to continue
Exception
- if it's not possible to launch the given commandpublic void destroy()
public String getError()
execute(boolean)
method was not called, otherwise the data of
the error streampublic String getOutput()
execute(boolean)
method was not called, otherwise the data of
the o streampublic void setWorkingDirectory(File pWorkDir)
pWorkDir
- the directorypublic File getWorkingDirectory()
null
if no directory is setpublic void setOutputForwarder(PrintStream pOutput)
pOutput
- the streampublic PrintStream getOutputForwarder()
null
if no stream is setpublic void setErrorForwarder(PrintStream pError)
pError
- the streampublic PrintStream getErrorForwarder()
null
if no stream is setpublic void addListener(IExecuteListener pListener)
pListener
- the listenerpublic void removeListener(IExecuteListener pListener)
pListener
- the listenerpublic void send(byte[] pData) throws IOException
pData
- the data
IOException
- if program is not executed or a transmission error occurspublic boolean isRunning()
true
if the program is executed and still running, false
otherwisepublic void setParamsLogEnabled(boolean pLog)
pLog
- true
to turn off logging, false
to use loggingpublic boolean isParamsLogEnabled()
true
if parameter logging is enabled, false
if parameter logging is disabledpublic void setBufferCharacterCount(int pCharCount)
pCharCount
- the number of characters or -1
for unlimited charactersgetBufferCharacterCount()
public int getBufferCharacterCount()
-1
for unlimited characters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |