code: public synchronized void consumeLine(final String line) {
  
          // check if the output contains the error string
          if (StringUtils.isNotEmpty(errorStr)) {
              // YES: set error flag
              if (StringUtils.equalsIgnoreCase(line.trim(), errorStr)) {
                  foundError = true;
              }
          }
      }
docs: Ugly parsing of Exec output into some Elements. Gets called from StreamPumper.
  
  @param line the line of output to parse