Class OutputCollector

java.lang.Object
com.bmuschko.gradle.docker.internal.OutputCollector
All Implemented Interfaces:
Closeable, AutoCloseable

public final class OutputCollector extends Object implements Closeable
A utility class that will collect strings until a new line is encountered.
  • Constructor Details

  • Method Details

    • accept

      public void accept(String input)
      Accept a string as input. The collector will save the inputs until a new line is encountered, or the collector is closed. The newlines are stripped and not present in the output.
      Parameters:
      input - The string to accept.
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException