com.tw.go.plugin.cmd.ProcessOutputStreamConsumer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of git-cmd Show documentation
Show all versions of git-cmd Show documentation
Common module that all Go CD plugins can use to poll Git repository.
package com.tw.go.plugin.cmd;
import org.apache.commons.exec.LogOutputStream;
import java.util.List;
public class ProcessOutputStreamConsumer extends LogOutputStream {
private StreamConsumer streamConsumer;
public ProcessOutputStreamConsumer(StreamConsumer streamConsumer) {
this.streamConsumer = streamConsumer;
}
public void consumeLine(String line) {
streamConsumer.consumeLine(line);
}
public List output() {
return streamConsumer.asList();
}
@Override
protected void processLine(String line, int level) {
consumeLine(line);
}
}