Class StreamToListPumper

  • All Implemented Interfaces:
    Runnable
    Direct Known Subclasses:
    ErrorStreamToListPumper

    public class StreamToListPumper
    extends Object
    implements 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 Detail

      • planKey

        protected final String planKey
    • Constructor Detail

      • StreamToListPumper

        public StreamToListPumper​(InputStream inputStream,
                                  Collection<String> outputList,
                                  BuildLogger buildLogger,
                                  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 Runnable
      • pump

        protected void pump​(BufferedReader reader)
                     throws IOException
        Pump the reader into myOutputList.
        Parameters:
        reader - The reader
        Throws:
        IOException - Something went wrong
      • log

        protected void log​(String line)