Package com.linkedin.alpini.io
Class SubprocessBuilder
- java.lang.Object
-
- com.linkedin.alpini.io.SubprocessBuilder
-
public class SubprocessBuilder extends java.lang.Object
A proxy class for java.lang.ProcessBuilder which may be overridden for purposes of test.
-
-
Constructor Summary
Constructors Constructor Description SubprocessBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ProcessBuilder
builder()
java.util.List<java.lang.String>
command()
SubprocessBuilder
command(java.lang.String... command)
SubprocessBuilder
command(java.util.List<java.lang.String> command)
java.io.File
directory()
SubprocessBuilder
directory(java.io.File directory)
java.util.Map<java.lang.String,java.lang.String>
environment()
java.lang.ProcessBuilder
processBuilder()
boolean
redirectErrorStream()
SubprocessBuilder
redirectErrorStream(boolean redirectErrorStream)
void
setStdErrLog(java.util.function.Consumer<java.lang.String> consumer)
When the process is started , log the process stderr to the Logger.void
setStdOutLog(java.util.function.Consumer<java.lang.String> consumer)
When the process is started , log the process stdout to the Logger.java.lang.Process
start()
java.lang.String
toString()
-
-
-
Method Detail
-
builder
protected java.lang.ProcessBuilder builder()
-
command
public java.util.List<java.lang.String> command()
- See Also:
ProcessBuilder.command()
-
command
public SubprocessBuilder command(java.util.List<java.lang.String> command)
- See Also:
ProcessBuilder.command(java.util.List)
-
command
public SubprocessBuilder command(java.lang.String... command)
- See Also:
ProcessBuilder.command(String...)
-
directory
public java.io.File directory()
- See Also:
ProcessBuilder.directory()
-
directory
public SubprocessBuilder directory(java.io.File directory)
- See Also:
ProcessBuilder.directory(java.io.File)
-
environment
public java.util.Map<java.lang.String,java.lang.String> environment()
- See Also:
ProcessBuilder.environment()
-
redirectErrorStream
public boolean redirectErrorStream()
- See Also:
ProcessBuilder.redirectErrorStream()
-
redirectErrorStream
public SubprocessBuilder redirectErrorStream(boolean redirectErrorStream)
- See Also:
ProcessBuilder.redirectErrorStream(boolean)
-
processBuilder
public java.lang.ProcessBuilder processBuilder()
-
start
public java.lang.Process start() throws java.io.IOException
- Throws:
java.io.IOException
- See Also:
ProcessBuilder.start()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setStdOutLog
public void setStdOutLog(java.util.function.Consumer<java.lang.String> consumer)
When the process is started , log the process stdout to the Logger. This must be called before starting the process.- Parameters:
consumer
- Log for std out
-
setStdErrLog
public void setStdErrLog(java.util.function.Consumer<java.lang.String> consumer)
When the process is started , log the process stderr to the Logger. This must be called before starting the process.- Parameters:
consumer
- Log for std err
-
-