common.io
Class ProcessExecutor.BufferingVisitor

java.lang.Object
  extended by common.io.ProcessExecutor.BufferingVisitor
All Implemented Interfaces:
ProcessExecutor.Visitor
Enclosing class:
ProcessExecutor

public static class ProcessExecutor.BufferingVisitor
extends java.lang.Object
implements ProcessExecutor.Visitor

A visitor that just buffers the output of the process and makes it available for retrieval.


Nested Class Summary
static class ProcessExecutor.BufferingVisitor.Streams
           
 
Constructor Summary
ProcessExecutor.BufferingVisitor()
           
ProcessExecutor.BufferingVisitor(ProcessExecutor.BufferingVisitor.Streams stream)
           
 
Method Summary
 byte[] getError()
           
 java.lang.String getErrorString()
           
 byte[] getOutput()
           
 java.lang.String getOutputString()
           
 boolean process(byte[] buf, int len, boolean isError)
          Called when data is read from the process output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessExecutor.BufferingVisitor

public ProcessExecutor.BufferingVisitor()

ProcessExecutor.BufferingVisitor

public ProcessExecutor.BufferingVisitor(ProcessExecutor.BufferingVisitor.Streams stream)
Method Detail

process

public boolean process(byte[] buf,
                       int len,
                       boolean isError)
Description copied from interface: ProcessExecutor.Visitor
Called when data is read from the process output.

This method is called with buf set to null on EOF.

Specified by:
process in interface ProcessExecutor.Visitor
Parameters:
buf - Data from the output.
len - How much data in the buffer is valid.
isError - Whether data is from error output.
Returns:
Whether to continue reading the output.

getOutput

public byte[] getOutput()

getOutputString

public java.lang.String getOutputString()

getError

public byte[] getError()

getErrorString

public java.lang.String getErrorString()