java.lang.Object | |
↳ | java.lang.ProcessBuilder |
Creates operating system processes.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
ProcessBuilder instance with the specified
operating system program and its arguments. | |||||||||||
Constructs a new
ProcessBuilder instance with the specified
operating system program and its arguments. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Changes the program and arguments of this process builder.
| |||||||||||
Changes the program and arguments of this process builder.
| |||||||||||
Returns this process builder's current program and arguments.
| |||||||||||
Changes the working directory of this process builder.
| |||||||||||
Returns the working directory of this process builder.
| |||||||||||
Returns this process builder's current environment.
| |||||||||||
Changes the state of whether or not standard error is redirected to
standard output.
| |||||||||||
Indicates whether the standard error should be redirected to standard
output.
| |||||||||||
Starts a new process based on the current state of this process builder.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Constructs a new ProcessBuilder
instance with the specified
operating system program and its arguments.
command | the requested operating system program and its arguments. |
---|
Constructs a new ProcessBuilder
instance with the specified
operating system program and its arguments. Note that the list passed to
this constructor is not copied, so any subsequent updates to it are
reflected in this instance's state.
command | the requested operating system program and its arguments. |
---|
NullPointerException | if command is null . |
---|
Changes the program and arguments of this process builder.
command | the new operating system program and its arguments. |
---|
Changes the program and arguments of this process builder. Note that the list passed to this method is not copied, so any subsequent updates to it are reflected in this instance's state.
command | the new operating system program and its arguments. |
---|
NullPointerException | if command is null . |
---|
Returns this process builder's current program and arguments. Note that the returned list is not a copy and modifications to it will change the state of this instance.
Changes the working directory of this process builder. If the specified
directory is null
, then the working directory of the Java
process is used when a process is started.
directory | the new working directory for this process builder. |
---|
Returns the working directory of this process builder. If null
is
returned, then the working directory of the Java process is used when a
process is started.
null
.Returns this process builder's current environment. When a process builder instance is created, the environment is populated with a copy of the environment, as returned by getenv(). Note that the map returned by this method is not a copy and any changes made to it are reflected in this instance's state.
Changes the state of whether or not standard error is redirected to standard output.
redirectErrorStream | true to redirect standard error, false
otherwise. |
---|
Indicates whether 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().
true
if the standard error is redirected; false
otherwise.Starts a new process based on the current state of this process builder.
Process
instance.NullPointerException | if any of the elements of command() is null . |
---|---|
IndexOutOfBoundsException | if command() is empty. |
SecurityException | if checkExec(String) doesn't allow process creation. |
IOException | if an I/O error happens. |