Package nl.vpro.util

Interface CommandExecutor

All Known Implementing Classes:
CommandExecutorImpl

public interface CommandExecutor
Executor for external commands.

Three types of methods:

  1. execute(InputStream, OutputStream, OutputStream, String...) To synchronously execute and return exit code.
  2. submit(java.io.InputStream, java.io.OutputStream, java.io.OutputStream, java.util.function.IntConsumer, java.lang.String...) For asynchronous execution
These two also have versions with a CommandExecutor.Parameters (or CommandExecutor.Parameters.Builder or Consumer<Parameters.Builder>) argument, so you can use the builder pattern to fill in parameters.
  1. lines(InputStream, OutputStream, String...) For synchronous execution and returing the output as a stream of strings.
Since:
1.6
Author:
Michiel Meeuwissen