com.atlassian.bamboo.command
Class StreamToListPumper

java.lang.Object
  extended by com.atlassian.bamboo.command.StreamToListPumper
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ErrorStreamToListPumper

public class StreamToListPumper
extends java.lang.Object
implements java.lang.Runnable

This class pumps the contents of an input stream into a list (as well as the build logs). It is designed to be executed within a thread.

Basically a variation of the Ant StreamPumper that puts in the output in a list


Field Summary
protected  BuildLogger buildLogger
           
protected  java.lang.String planKey
           
 
Constructor Summary
StreamToListPumper(java.io.InputStream inputStream, java.util.Collection<java.lang.String> outputList, BuildLogger buildLogger, java.lang.String planKey)
          Pump the given inputStream into the given outputList
 
Method Summary
protected  void log(java.lang.String line)
           
protected  void pump(java.io.BufferedReader reader)
          Pump the reader into myOutputList.
 void run()
          Convert the input stream into a list within the thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buildLogger

protected final BuildLogger buildLogger

planKey

protected final java.lang.String planKey
Constructor Detail

StreamToListPumper

public StreamToListPumper(java.io.InputStream inputStream,
                          java.util.Collection<java.lang.String> outputList,
                          BuildLogger buildLogger,
                          java.lang.String planKey)
Pump the given inputStream into the given outputList

Parameters:
inputStream - input data stream
outputList - resulting collection of lines
buildLogger - the logger for the build
planKey - the plankey for the build
Method Detail

run

public void run()
Convert the input stream into a list within the thread

Specified by:
run in interface java.lang.Runnable

pump

protected void pump(java.io.BufferedReader reader)
             throws java.io.IOException
Pump the reader into myOutputList.

Parameters:
reader - The reader
Throws:
java.io.IOException - Something went wrong

log

protected void log(java.lang.String line)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.