@Override protected void onTextAvailable(String text, Key outputType) { Iterator<String> lines = LineHandlerHelper.splitText(text).iterator(); if (ProcessOutputTypes.STDOUT == outputType) { notifyLines(outputType, lines, myStdoutLine); } else if (ProcessOutputTypes.STDERR == outputType) { notifyLines(outputType, lines, myStderrLine); } }
private void notifyLine(final String line, final Key outputType) { String trimmed = LineHandlerHelper.trimLineSeparator(line); myLineListeners.getMulticaster().onLineAvailable(trimmed, outputType); }