|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.util.ProcessExec
public final class ProcessExec
Utility class for correct executing external processes. This class was insipred by article http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
| Field Summary | |
|---|---|
static int |
INTERRUPTED_PROCESS_RETURN_VALUE
Return value used when waiting for process to finish was interrupted. |
static java.lang.Integer |
INTERRUPTED_PROCESS_RETURN_VALUE_OBJ
Return value used when waiting for process to finish was interrupted. |
| Method Summary | |
|---|---|
static java.lang.Object[] |
execute(java.lang.String[] commandline,
java.lang.String[] environment,
java.io.File workingDir,
boolean bCapture,
long lMaxCaptureSize)
Execute specified command or process and returns immidiately even before the command finished. |
static java.lang.Object[] |
execute(java.lang.String commandline,
boolean bCapture)
Execute specified command or process and returns immidiately even before the command finished. |
static java.lang.Object[] |
executeAndWait(java.lang.String[] commandline,
java.lang.String[] environment,
java.io.File workingDir,
boolean bCapture,
long lMaxCaptureSize)
Execute specified command or process and returns immidiately even before the command finished. |
static java.lang.Object[] |
executeAndWait(java.lang.String commandline,
boolean bCapture)
Execute specified command or process and returns immidiately even before the command finished. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int INTERRUPTED_PROCESS_RETURN_VALUE
public static final java.lang.Integer INTERRUPTED_PROCESS_RETURN_VALUE_OBJ
| Method Detail |
|---|
public static java.lang.Object[] executeAndWait(java.lang.String commandline,
boolean bCapture)
throws java.io.IOException,
OSSException
commandline - - array containing the command to call and its arguments,
see Runtime.exec for more descriptionbCapture - - if true then the output and error will be captured
(carefull about memory) and can be read
java.io.IOException - - error in function
OSSException - - error in function
public static java.lang.Object[] executeAndWait(java.lang.String[] commandline,
java.lang.String[] environment,
java.io.File workingDir,
boolean bCapture,
long lMaxCaptureSize)
throws java.io.IOException
commandline - - array containing the command to call and its arguments,
see Runtime.exec for more descriptionenvironment - - array containing the environment for the process
or just null to inherit environment,
see Runtime.exec for more descriptionworkingDir - - current working directory for the process or just null
to inherit from parent
see Runtime.exec for more descriptionbCapture - - if true then the output and error will be captured
(carefull about memory) and can be readlMaxCaptureSize - - maximal size of EACH output to be held in memory.
java.io.IOException - - error in function
public static java.lang.Object[] execute(java.lang.String commandline,
boolean bCapture)
throws java.io.IOException,
OSSException
commandline - - String containing the command to call and its arguments
it will be parsed to follow requirements of Runtime.execbCapture - - if true then the output and error will be captured
(carefull about memory) and can be read
java.io.IOException - - error in function
OSSException - - error in function
public static java.lang.Object[] execute(java.lang.String[] commandline,
java.lang.String[] environment,
java.io.File workingDir,
boolean bCapture,
long lMaxCaptureSize)
throws java.io.IOException
commandline - - array containing the command to call and its arguments,
see Runtime.exec for more descriptionenvironment - - array containing the environment for the process
or just null to inherit environment,
see Runtime.exec for more descriptionworkingDir - - current working directory for the process or just null
to inherit from parent
see Runtime.exec for more descriptionbCapture - - if true then the output and error will be captured
(carefull about memory) and can be readlMaxCaptureSize - - maximal size of EACH output to be held in memory.
java.io.IOException - - error in function
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||