Class RuntimeExec.InputStreamReaderThread

java.lang.Object
java.lang.Thread
org.alfresco.util.exec.RuntimeExec.InputStreamReaderThread
All Implemented Interfaces:
Runnable
Enclosing class:
RuntimeExec

public static class RuntimeExec.InputStreamReaderThread extends Thread
Gobbles an InputStream and writes it into a StringBuffer

The reading of the input stream is buffered.

  • Constructor Details

    • InputStreamReaderThread

      public InputStreamReaderThread(InputStream is, Charset charset)
      Parameters:
      is - an input stream to read - it will be wrapped in a buffer for reading
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • waitForCompletion

      public void waitForCompletion()
      Waits for the run to complete.

      Remember to start the thread first

    • addToBuffer

      public void addToBuffer(String msg)
      Parameters:
      msg - the message to add to the buffer
    • isComplete

      public boolean isComplete()
    • getBuffer

      public String getBuffer()
      Returns:
      Returns the current state of the buffer