java.lang.Object | ||
java.lang.ProcessBuilder |
A builder for creating OS-specific processes.
ProcessBuilder(String[] command) | ||||||
Constructs an instance with the given command. |
||||||
ProcessBuilder(List<String> command) | ||||||
Constructs an instance with the given command. |
ProcessBuilder | command(String[] command) | |||||
Changes the program and arguments to the command given. |
||||||
ProcessBuilder | command(List<String> command) | |||||
Changes the program and arguments to the command given. |
||||||
List<String> | command() | |||||
The builder's current program and arguments. |
||||||
ProcessBuilder | directory(File directory) | |||||
Changes the working directory to the directory given. |
||||||
File | directory() | |||||
The working directory that's currently set. |
||||||
Map<String, String> | environment() | |||||
The builder's current environment. |
||||||
ProcessBuilder | redirectErrorStream(boolean redirectErrorStream) | |||||
Changes the state of whether or not standard error is redirected. |
||||||
boolean | redirectErrorStream() | |||||
Indicates whether or not the standard error should be redirected to standard output. |
||||||
Process | start() | |||||
Starts a new process based on the current state of the builder. |
Constructs an instance with the given command.
command | The program and arguments. |
---|
Constructs an instance with the given command.
command | The program and arguments. |
---|
NullPointerException | if command is null .
|
---|
Changes the program and arguments to the command given.
command | The program and arguments. |
---|
Changes the program and arguments to the command given. The list passed is not copied, so any subsequent updates to it are reflected in this instance's state.
command | The program and arguments. |
---|
NullPointerException | if command is null .
|
---|
The builder's current program and arguments. The returned value is considered live and modifications to it will change the state of the instance.
Changes the working directory to the directory given. If the given
directory is null
, then the working directory of the Java
process is used when a process is started.
directory | The working directory to set. |
---|
The working directory that's currently set. If this value is
null
, then the working directory of the Java process is
used.
null
.
The builder's current environment. When an instance is created, the environment is populated with a copy of the environment, as returned by getenv(). The Map returned is live and any changes made to it are reflected in this instance's state.
Changes the state of whether or not standard error is redirected.
redirectErrorStream | true to redirect standard error,
false if not. |
---|
Indicates whether or not the standard error should be redirected to standard output. If redirected, the getErrorStream() will always return end of stream and standard error is written to getInputStream().
Starts a new process based on the current state of the builder.
NullPointerException | if any of the elements of command() are
null . |
---|---|
IndexOutOfBoundsException | if command() is empty. |
SecurityException | if checkExec(String) doesn't allow process creation. |
IOException | if an I/O error happens. |
Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:56 |