com.continuent.tungsten.common.exec
Class FileInputStreamSink

java.lang.Object
  extended by com.continuent.tungsten.common.exec.FileInputStreamSink
All Implemented Interfaces:
InputStreamSink, java.lang.Runnable

public class FileInputStreamSink
extends java.lang.Object
implements InputStreamSink

Runnable to read from an InputStream and store the results in a file.


Constructor Summary
FileInputStreamSink(java.lang.String tag, java.io.InputStream in, java.io.File outputFile, boolean append)
          Creates a new instance.
 
Method Summary
 java.lang.String getOutput()
          Return output lines if we are storing output in a string or null if storing to a file.
 void run()
          Reads from the input stream and stores output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileInputStreamSink

public FileInputStreamSink(java.lang.String tag,
                           java.io.InputStream in,
                           java.io.File outputFile,
                           boolean append)
                    throws java.io.FileNotFoundException
Creates a new instance.

Parameters:
tag - A tag for this processor to help with logging
in - InputStream from which we read
outputFile - File in which to store output
append - If true append output to file, otherwise overwrite
Throws:
java.io.FileNotFoundException
Method Detail

run

public void run()
Reads from the input stream and stores output. Terminates when the input stream ends.

Specified by:
run in interface InputStreamSink
Specified by:
run in interface java.lang.Runnable
See Also:
InputStreamSink.run()

getOutput

public java.lang.String getOutput()
Return output lines if we are storing output in a string or null if storing to a file.

Specified by:
getOutput in interface InputStreamSink
Returns:
Output line array.
See Also:
InputStreamSink.getOutput()