public class SystemCommand extends Object
Modifier and Type | Field and Description |
---|---|
static int |
POLL_INTERVAL |
Constructor and Description |
---|
SystemCommand(File directory,
long timeoutMillis,
int pollInterval,
Map<String,String> env,
InputStream stdin,
OutputStream stdout,
OutputStream stderr) |
SystemCommand(File directory,
long timeoutMillis,
int pollInterval,
Map<String,String> env,
String stdin,
String stdout,
String stderr) |
SystemCommand(File directory,
Map<String,String> env) |
public static final int POLL_INTERVAL
public SystemCommand(File directory, Map<String,String> env)
env
- Environment variables appended to environment (may be null)directory
- File working directory (may be null)public SystemCommand(File directory, long timeoutMillis, int pollInterval, Map<String,String> env, String stdin, String stdout, String stderr) throws IOException
env
- Environment variables appended to environment (may be null)directory
- File working directory (may be null)timeoutMillis
- timeout in MillisecondspollInterval
- Value used to poll for Process execution endstdin
- File name that will contain data to be input to process (may be null)stdout
- File name that will contain out stream (may be null)stderr
- File name that will contain err stream (may be null)IOException
- if the input file is not found or output cannot be writtenpublic SystemCommand(File directory, long timeoutMillis, int pollInterval, Map<String,String> env, InputStream stdin, OutputStream stdout, OutputStream stderr)
env
- Environment variables appended to environment (may be null)directory
- File working directory (may be null)timeoutMillis
- timeout in MillisecondspollInterval
- Value used to poll for Process execution endstdin
- File name that will contain data to be input to process (may be null)stdout
- File name that will contain out stream (may be null)stderr
- File name that will contain err stream (may be null)public int run(List<String> arguments) throws InterruptedException, IOException
arguments
- List of strings, not nullInterruptedException
- when execution was interruptedIOException
- when I/O error occurs while executionpublic int run(List<String> arguments1, List<String> arguments2) throws InterruptedException, IOException
arguments1
- first command to runarguments2
- second command to runInterruptedException
- when execution gets interruptedIOException
- when I/O error occurs while executionpublic String getOutResult()
Copyright © 1998-2016 Apache Software Foundation. All Rights Reserved.