ProcessBuilder class

This class is used to create operating system processes.

Create ProcessBuilder

ConstructorSummary
ProcessBuilder(List<String> command) Creates a process builder with the specified operating system program and arguments.
ProcessBuilder(String... command)Creates a process builder with the specified operating system program and arguments.

Execute system command

ReturnMethodSummary
List<String>command()Returns this process builder's operating system program and arguments.
ProcessBuilder command(List<String> command) Sets this process builder's operating system program and arguments.
ProcessBuildercommand(String... command)Sets this process builder's operating system program and arguments.

Get/set the working directory

ReturnMethodSummary
Filedirectory()Returns this process builder's working directory.
ProcessBuilderdirectory(File directory)Sets this process builder's working directory.

Get the environment variables

ReturnMethodSummary
Map<String,String>environment()Returns a string map view of this process builder's environment.

Redirect error stream

ReturnMethodSummary
booleanredirectErrorStream()Tells whether this process builder merges standard error and standard output.
ProcessBuilderredirectErrorStream(boolean redirectErrorStream)Sets this process builder's redirectErrorStream property.

Start a new process

ReturnMethodSummary
Processstart()Starts a new process using the attributes of this process builder.
Revised from Open JDK source code
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.