| Package | Description |
|---|---|
| org.zeroturnaround.exec | |
| org.zeroturnaround.exec.listener |
| Modifier and Type | Method and Description |
|---|---|
ProcessExecutor |
ProcessExecutor.addDestroyer(ProcessDestroyer destroyer)
Adds a process destroyer to be notified when the process starts and stops.
|
ProcessExecutor |
ProcessExecutor.addListener(ProcessListener listener)
Register new process event handler.
|
ProcessExecutor |
ProcessExecutor.clearListeners()
Unregister all existing process event handlers.
|
ProcessExecutor |
ProcessExecutor.closeTimeout(long timeout,
TimeUnit unit)
Sets a timeout for closing standard streams of the process being executed.
|
ProcessExecutor |
ProcessExecutor.command(Iterable<String> command)
Sets the program and its arguments which are being executed.
|
ProcessExecutor |
ProcessExecutor.command(List<String> command)
Sets the program and its arguments which are being executed.
|
ProcessExecutor |
ProcessExecutor.command(String... command)
Sets the program and its arguments which are being executed.
|
ProcessExecutor |
ProcessExecutor.commandSplit(String commandWithArgs)
Splits string by spaces and passes it to
command(String...)NB: this method do not handle whitespace escaping, "mkdir new\ folder" would be interpreted as
{"mkdir", "new\", "folder"} command. |
ProcessExecutor |
ProcessExecutor.debug()
Deprecated.
|
ProcessExecutor |
ProcessExecutor.debug(org.slf4j.Logger log)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.debug(String name)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.destroyer(ProcessDestroyer destroyer)
Sets the process destroyer to be notified when the process starts and stops.
|
ProcessExecutor |
ProcessExecutor.destroyOnExit()
Sets the started process to be destroyed on VM exit (shutdown hooks are executed).
|
ProcessExecutor |
ProcessExecutor.directory(File directory)
Sets this working directory for the process being executed.
|
ProcessExecutor |
ProcessExecutor.environment(Map<String,String> env)
Adds additional environment variables for the process being executed.
|
ProcessExecutor |
ProcessExecutor.environment(String name,
String value)
Adds a single additional environment variable for the process being executed.
|
ProcessExecutor |
ProcessExecutor.exitValue(Integer exitValue)
Sets the allowed exit value for the process being executed.
|
ProcessExecutor |
ProcessExecutor.exitValueAny()
Allows any exit value for the process being executed.
|
ProcessExecutor |
ProcessExecutor.exitValueNormal()
Allows only
0 as the exit value for the process being executed. |
ProcessExecutor |
ProcessExecutor.exitValues(int[] exitValues)
Sets the allowed exit values for the process being executed.
|
ProcessExecutor |
ProcessExecutor.exitValues(Integer... exitValues)
Sets the allowed exit values for the process being executed.
|
ProcessExecutor |
ProcessExecutor.info()
Deprecated.
|
ProcessExecutor |
ProcessExecutor.info(org.slf4j.Logger log)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.info(String name)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.listener(ProcessListener listener)
Unregister all existing process event handlers and register new one.
|
ProcessExecutor |
ProcessExecutor.readOutput(boolean readOutput)
Sets this process executor's
readOutput property. |
ProcessExecutor |
ProcessExecutor.redirectError(OutputStream output)
Redirects the process' error stream to given output stream.
|
ProcessExecutor |
ProcessExecutor.redirectErrorAlsoTo(OutputStream output)
Redirects the process' error stream also to a given output stream.
|
ProcessExecutor |
ProcessExecutor.redirectErrorAsDebug()
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectErrorAsDebug(org.slf4j.Logger log)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectErrorAsDebug(String name)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectErrorAsInfo()
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectErrorAsInfo(org.slf4j.Logger log)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectErrorAsInfo(String name)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectErrorStream(boolean redirectErrorStream)
Sets this process executor's
redirectErrorStream property. |
ProcessExecutor |
ProcessExecutor.redirectInput(InputStream input)
Sets the input stream to redirect to the process' input stream.
|
ProcessExecutor |
ProcessExecutor.redirectOutput(OutputStream output)
Redirects the process' output stream to given output stream.
|
ProcessExecutor |
ProcessExecutor.redirectOutputAlsoTo(OutputStream output)
Redirects the process' output stream also to a given output stream.
|
ProcessExecutor |
ProcessExecutor.redirectOutputAsDebug()
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectOutputAsDebug(org.slf4j.Logger log)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectOutputAsDebug(String name)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectOutputAsInfo()
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectOutputAsInfo(org.slf4j.Logger log)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.redirectOutputAsInfo(String name)
Deprecated.
|
ProcessExecutor |
ProcessExecutor.removeListener(ProcessListener listener)
Unregister existing process event handler.
|
ProcessExecutor |
ProcessExecutor.removeListeners(Class<? extends ProcessListener> listenerType)
Unregister existing process event handlers of given type or its sub-types.
|
ProcessExecutor |
ProcessExecutor.setMessageLogger(MessageLogger messageLogger)
Changes how most common messages about starting and waiting for processes are actually logged.
|
ProcessExecutor |
ProcessExecutor.stopper(ProcessStopper stopper)
Sets the helper for stopping the process in case of timeout or cancellation.
|
ProcessExecutor |
ProcessExecutor.streams(ExecuteStreamHandler streams)
Sets a stream handler for the process being executed.
|
ProcessExecutor |
ProcessExecutor.timeout(long timeout,
TimeUnit unit)
Sets a timeout for the process being executed.
|
| Modifier and Type | Method and Description |
|---|---|
void |
CompositeProcessListener.afterStart(Process process,
ProcessExecutor executor) |
void |
DestroyerListenerAdapter.afterStart(Process process,
ProcessExecutor executor) |
void |
ProcessListener.afterStart(Process process,
ProcessExecutor executor)
Invoked after a process has started.
|
void |
CompositeProcessListener.beforeStart(ProcessExecutor executor) |
void |
ProcessListener.beforeStart(ProcessExecutor executor)
Invoked before a process is started.
|
Copyright © 2020 ZeroTurnaround. All rights reserved.