public static class ProcessConfiguration.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
ProcessConfiguration.Builder |
arguments(List<String> arguments)
Add the process arguments.
|
ProcessConfiguration.Builder |
arguments(String... arguments)
Adds the process arguments.
|
ProcessConfiguration |
build() |
ProcessConfiguration.Builder |
charset(Charset charset)
Sets the charset of the subprocess output stream used if the
redirectType is RedirectType.STRING. |
ProcessConfiguration.Builder |
env(Map<String,String> env)
Adds the environment variables.
|
ProcessConfiguration.Builder |
env(String name,
String value)
Adds the environment variable.
|
ProcessConfiguration.Builder |
name(String name)
Sets the process display name.
|
ProcessConfiguration.Builder |
redirectType(ProcessConfiguration.RedirectType redirectType)
Sets the redirect type.
|
ProcessConfiguration.Builder |
waitForOutputLineRegexp(String waitForOutputLineRegexp)
Sets the Java regular expression of a line from the process output stream.
|
ProcessConfiguration.Builder |
waitForOutputLineTimeout(Long waitForOutputLineTimeout)
Sets the timeout for waiting for a specific line from the process output stream (in seconds).
|
ProcessConfiguration.Builder |
waitSeconds(Long waitSeconds)
Sets the maximum number of seconds to wait after the start of the process.
|
ProcessConfiguration.Builder |
workingDir(String workingDir)
Sets the process working directory.
|
public Builder(String executable)
public ProcessConfiguration build()
public ProcessConfiguration.Builder name(String name)
name - the process display name.public ProcessConfiguration.Builder arguments(String... arguments)
arguments - the process arguments.public ProcessConfiguration.Builder arguments(List<String> arguments)
arguments - the process arguments.public ProcessConfiguration.Builder workingDir(String workingDir)
workingDir - the process working directory. If null (the default value) then the current directory will be used.public ProcessConfiguration.Builder env(String name, String value)
name - the environment variable name.value - the environment variable value.public ProcessConfiguration.Builder env(Map<String,String> env)
env - the environment variables.public ProcessConfiguration.Builder waitSeconds(Long waitSeconds)
waitSeconds - the maximum number of seconds to wait or null (the default value) if the thread shouldn't wait.public ProcessConfiguration.Builder redirectType(ProcessConfiguration.RedirectType redirectType)
RedirectType.INHERIT.redirectType - the redirect type.public ProcessConfiguration.Builder charset(Charset charset)
redirectType is RedirectType.STRING.charset - the charset.public ProcessConfiguration.Builder waitForOutputLineRegexp(String waitForOutputLineRegexp)
waitForOutputLineRegexp - the Java regular expression or null if the thread shouldn't wait for a specific line.public ProcessConfiguration.Builder waitForOutputLineTimeout(Long waitForOutputLineTimeout)
waitForOutputLineTimeout - the timeout for waiting for a specific line or null if the thread could wait
indefinitely.Copyright © 2016–2018 Softelnet. All rights reserved.