|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectledge.external.ProcessExecutor
public class ProcessExecutor
| Field Summary | |
|---|---|
static String |
DEFAULT_SHELL
Default shell invocation format. |
private org.jcontainer.dna.Logger |
log
The logger. |
private String[] |
shellTokens
Shell invocation format. |
| Constructor Summary | |
|---|---|
ProcessExecutor(org.jcontainer.dna.Logger logger,
org.jcontainer.dna.Configuration configuration)
Creates a new ProcessExecutor instance. |
|
ProcessExecutor(org.jcontainer.dna.Logger logger,
String shell)
Creates a new ProcessExecutor instance. |
|
| Method Summary | |
|---|---|
private String |
concat(String[] args)
|
ExecutionResult |
exec(boolean captureOutput,
boolean captureError,
String... args)
Executes an external process. |
ExecutionResult |
exec(byte[] input,
boolean captureOutput,
boolean captureError,
String... args)
Executes an external process. |
ExecutionResult |
exec(String... args)
Execute an external process. |
ExecutionResult |
exec(String input,
boolean captureOutput,
boolean captureError,
String... args)
Executes an external process. |
private byte[] |
read(File file)
|
private void |
release(File file)
|
private void |
write(File file,
byte[] bytes)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_SHELL
private final String[] shellTokens
private final org.jcontainer.dna.Logger log
| Constructor Detail |
|---|
public ProcessExecutor(org.jcontainer.dna.Logger logger,
String shell)
logger - the logger to use.shell - the shell invocation format.
public ProcessExecutor(org.jcontainer.dna.Logger logger,
org.jcontainer.dna.Configuration configuration)
logger - the logger to use.configuration - component configuration.| Method Detail |
|---|
public ExecutionResult exec(String... args)
throws IOException
No data is sent to the process input stream, output and error streams are not captured.
args - the script name and arguments.
IOException - If the execution fails.
public ExecutionResult exec(byte[] input,
boolean captureOutput,
boolean captureError,
String... args)
throws IOException
input - data to be passed to the process inpupt stream.captureOutput - should process output stream be captured.captureError - should process error stream be captured.args - process executable name and arguments.
IOException - If the execution fails.
public ExecutionResult exec(String input,
boolean captureOutput,
boolean captureError,
String... args)
throws IOException
input - data to be passed to the process inpupt stream.captureOutput - should process output stream be captured.captureError - should process error stream be captured.args - process executable name and arguments.
IOException
IOException - If the execution fails.
public ExecutionResult exec(boolean captureOutput,
boolean captureError,
String... args)
throws IOException
captureOutput - should process output stream be captured.captureError - should process error stream be captured.args - process executable name and arguments.
IOException
IOException - If the execution fails.
private byte[] read(File file)
throws IOException
IOException
private void write(File file,
byte[] bytes)
throws IOException
IOExceptionprivate void release(File file)
private String concat(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||