Class ProcessStreamFactory
- java.lang.Object
-
- com.github.toolarium.system.command.process.stream.ProcessStreamFactory
-
public final class ProcessStreamFactory extends java.lang.Object
The process stream factory
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IProcessInputStream
getEmptyStandardIn()
Get the standard in as process input streamstatic ProcessStreamFactory
getInstance()
Get the instanceProcessBufferOutputStream
getProcessBufferOutputStream()
Get a process output stream bufferProcessBufferOutputStream
getProcessBufferOutputStream(java.lang.String linePrefix)
Get a process output stream bufferProcessBufferOutputStream
getProcessBufferOutputStream(java.lang.String linePrefix, IProcessStreamExceptionHandler processStreamExceptionHandler)
Get a process output stream bufferIProcessOutputStream
getProcessOutputStream(java.io.OutputStream os)
Get a process output stream which is wrapped by aOutputStream
.IProcessOutputStream
getProcessOutputStream(java.io.OutputStream os, java.lang.String linePrefix)
Get a process output stream which is wrapped by aOutputStream
.IProcessOutputStream
getProcessOutputStream(java.io.OutputStream os, java.lang.String linePrefix, IProcessStreamExceptionHandler processStreamExceptionHandler)
Get a process output stream which is wrapped by aOutputStream
.IProcessOutputStream
getSlf4jProcessOutputStream()
Get a process output stream bufferIProcessStreamExceptionHandler
getSlf4jProcessStreamExceptionHandler()
Get the standard in as process input streamIProcessOutputStream
getStandardErr()
Get the standard out as process error streamIProcessOutputStream
getStandardErr(java.lang.String linePrefix)
Get the standard out as process error streamIProcessOutputStream
getStandardErr(java.lang.String linePrefix, IProcessStreamExceptionHandler processStreamExceptionHandler)
Get the standard out as process error streamIProcessStreamExceptionHandler
getStandardErrProcessStreamExceptionHandler()
Get the standard in as process input streamIProcessInputStream
getStandardIn()
Get the standard in as process input streamIProcessInputStream
getStandardInFromBuffer(java.lang.String buffer)
Get the standard in read from the buffer as process input streamIProcessInputStream
getStandardInFromFile(java.io.File file)
Get the standard in as process input streamIProcessOutputStream
getStandardOut()
Get the standard out as process output streamIProcessOutputStream
getStandardOut(java.lang.String linePrefix)
Get the standard out as process output streamIProcessOutputStream
getStandardOut(java.lang.String linePrefix, IProcessStreamExceptionHandler processStreamExceptionHandler)
Get the standard out as process output streamIProcessStreamExceptionHandler
getStandardOutProcessStreamExceptionHandler()
Get the standard in as process input stream
-
-
-
Method Detail
-
getInstance
public static ProcessStreamFactory getInstance()
Get the instance- Returns:
- the instance
-
getStandardOut
public IProcessOutputStream getStandardOut()
Get the standard out as process output stream- Returns:
- the process output stream
-
getStandardOut
public IProcessOutputStream getStandardOut(java.lang.String linePrefix)
Get the standard out as process output stream- Parameters:
linePrefix
- the line prefix- Returns:
- the process output stream
-
getStandardOut
public IProcessOutputStream getStandardOut(java.lang.String linePrefix, IProcessStreamExceptionHandler processStreamExceptionHandler)
Get the standard out as process output stream- Parameters:
linePrefix
- the line prefixprocessStreamExceptionHandler
- the process stream exception handler or null- Returns:
- the process output stream
-
getStandardErr
public IProcessOutputStream getStandardErr()
Get the standard out as process error stream- Returns:
- the process output stream
-
getStandardErr
public IProcessOutputStream getStandardErr(java.lang.String linePrefix)
Get the standard out as process error stream- Parameters:
linePrefix
- the line prefix- Returns:
- the process output stream
-
getStandardErr
public IProcessOutputStream getStandardErr(java.lang.String linePrefix, IProcessStreamExceptionHandler processStreamExceptionHandler)
Get the standard out as process error stream- Parameters:
linePrefix
- the line prefixprocessStreamExceptionHandler
- the process stream exception handler or null- Returns:
- the process output stream
-
getProcessOutputStream
public IProcessOutputStream getProcessOutputStream(java.io.OutputStream os)
Get a process output stream which is wrapped by aOutputStream
.- Parameters:
os
- the output stream to pass as process output stream- Returns:
- the process output stream
-
getProcessOutputStream
public IProcessOutputStream getProcessOutputStream(java.io.OutputStream os, java.lang.String linePrefix)
Get a process output stream which is wrapped by aOutputStream
.- Parameters:
os
- the output stream to pass as process output streamlinePrefix
- the line prefix- Returns:
- the process output stream
-
getProcessOutputStream
public IProcessOutputStream getProcessOutputStream(java.io.OutputStream os, java.lang.String linePrefix, IProcessStreamExceptionHandler processStreamExceptionHandler)
Get a process output stream which is wrapped by aOutputStream
.- Parameters:
os
- the output stream to pass as process output streamlinePrefix
- the line prefixprocessStreamExceptionHandler
- the process stream exception handler or null- Returns:
- the process output stream
-
getProcessBufferOutputStream
public ProcessBufferOutputStream getProcessBufferOutputStream()
Get a process output stream buffer- Returns:
- a process output stream buffer
-
getProcessBufferOutputStream
public ProcessBufferOutputStream getProcessBufferOutputStream(java.lang.String linePrefix)
Get a process output stream buffer- Parameters:
linePrefix
- the line prefix- Returns:
- a process output stream buffer
-
getProcessBufferOutputStream
public ProcessBufferOutputStream getProcessBufferOutputStream(java.lang.String linePrefix, IProcessStreamExceptionHandler processStreamExceptionHandler)
Get a process output stream buffer- Parameters:
linePrefix
- the line prefixprocessStreamExceptionHandler
- the process stream exception handler or null- Returns:
- a process output stream buffer
-
getSlf4jProcessOutputStream
public IProcessOutputStream getSlf4jProcessOutputStream()
Get a process output stream buffer- Returns:
- a process output stream buffer
-
getStandardIn
public IProcessInputStream getStandardIn()
Get the standard in as process input stream- Returns:
- the process input stream
-
getEmptyStandardIn
public IProcessInputStream getEmptyStandardIn()
Get the standard in as process input stream- Returns:
- the process input stream
-
getStandardInFromBuffer
public IProcessInputStream getStandardInFromBuffer(java.lang.String buffer)
Get the standard in read from the buffer as process input stream- Parameters:
buffer
- the buffer- Returns:
- the process input stream
-
getStandardInFromFile
public IProcessInputStream getStandardInFromFile(java.io.File file)
Get the standard in as process input stream- Parameters:
file
- the file as input- Returns:
- the process input stream
-
getStandardOutProcessStreamExceptionHandler
public IProcessStreamExceptionHandler getStandardOutProcessStreamExceptionHandler()
Get the standard in as process input stream- Returns:
- the process input stream
-
getStandardErrProcessStreamExceptionHandler
public IProcessStreamExceptionHandler getStandardErrProcessStreamExceptionHandler()
Get the standard in as process input stream- Returns:
- the process input stream
-
getSlf4jProcessStreamExceptionHandler
public IProcessStreamExceptionHandler getSlf4jProcessStreamExceptionHandler()
Get the standard in as process input stream- Returns:
- the process input stream
-
-