java.lang.Object
org.itsallcode.process.SimpleProcessBuilder
Builder for
SimpleProcess
. Create a new instance with
create()
.-
Method Summary
Modifier and TypeMethodDescriptionSet program and arguments.Set program and arguments.static SimpleProcessBuilder
create()
Create a new instance.Set working directory to the current process's working directory.redirectErrorStream
(boolean redirectErrorStream) Redirect the error stream to the output stream if this istrue
.setStreamCloseTimeout
(Duration streamCloseTimeout) Set the timeout for closing the asynchronous stream readers.start()
Start the new process.streamConsumerExecutor
(Executor executor) Set a custom executor for asynchronous stream readers.streamLogLevel
(Level streamLogLevel) Log level for the process's stdout and stderr.workingDir
(Path workingDir) Set working directory.
-
Method Details
-
create
Create a new instance.- Returns:
- new
SimpleProcessBuilder
-
command
Set program and arguments.- Parameters:
command
- program and arguments- Returns:
this
for fluent programming- See Also:
-
command
Set program and arguments.- Parameters:
command
- program and arguments- Returns:
this
for fluent programming- See Also:
-
currentProcessWorkingDir
Set working directory to the current process's working directory.- Returns:
this
for fluent programming- See Also:
-
workingDir
Set working directory.- Parameters:
workingDir
- working directory- Returns:
this
for fluent programming- See Also:
-
redirectErrorStream
Redirect the error stream to the output stream if this istrue
.- Parameters:
redirectErrorStream
- the new property value, default:false
- Returns:
this
for fluent programming- See Also:
-
setStreamCloseTimeout
Set the timeout for closing the asynchronous stream readers.- Parameters:
streamCloseTimeout
- timeout- Returns:
this
for fluent programming
-
streamConsumerExecutor
Set a custom executor for asynchronous stream readers.Default: Create new threads on demand.
- Parameters:
executor
- executor- Returns:
this
for fluent programming
-
streamLogLevel
Log level for the process's stdout and stderr.Default:
Level.FINE
- Parameters:
streamLogLevel
- log level- Returns:
this
for fluent programming
-
start
Start the new process.- Returns:
- a new process
- See Also:
-