edu.internet2.middleware.grouper.util.CollectingLogOutputStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grouper Show documentation
Show all versions of grouper Show documentation
Internet2 Groups Management Toolkit
package edu.internet2.middleware.grouper.util;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.exec.LogOutputStream;
public class CollectingLogOutputStream extends LogOutputStream {
private final List lines = new LinkedList();
@Override protected void processLine(String line, int level) {
lines.add(line);
}
public List getLines() {
return lines;
}
public String getAllLines() {
if (lines.size() == 0) {
return "";
}
return GrouperUtil.join(lines.iterator(), '\n');
}
}