diff --git a/gradle.properties b/gradle.properties index c5549f9..72bcb68 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.14.4.1-SNAPSHOT +version=0.14.5.0-SNAPSHOT diff --git a/src/main/java/lv/ctco/scm/utils/exec/CapturingOutputStream.java b/src/main/java/lv/ctco/scm/utils/exec/CapturingOutputStream.java new file mode 100644 index 0000000..3aa8e9a --- /dev/null +++ b/src/main/java/lv/ctco/scm/utils/exec/CapturingOutputStream.java @@ -0,0 +1,13 @@ +package lv.ctco.scm.utils.exec; + +public class CapturingOutputStream extends ExecOutputStream { + + public CapturingOutputStream() { + this.setOutputFilter(new FullOutputFilter()); + } + + public CapturingOutputStream(ExecOutputFilter filter) { + this.setOutputFilter(filter); + } + +} diff --git a/src/main/java/lv/ctco/scm/utils/exec/ExecOutputStream.java b/src/main/java/lv/ctco/scm/utils/exec/ExecOutputStream.java index 11593d5..b47ec42 100644 --- a/src/main/java/lv/ctco/scm/utils/exec/ExecOutputStream.java +++ b/src/main/java/lv/ctco/scm/utils/exec/ExecOutputStream.java @@ -18,27 +18,35 @@ import java.util.ArrayList; import java.util.List; -public final class ExecOutputStream extends LogOutputStream { +public class ExecOutputStream extends LogOutputStream { - private final Logger logger = LoggerFactory.getLogger(getClass()); + private Logger logger; - private ExecOutputFilter outputFilter; - private ExecOutputFilter loggerFilter; + private ExecOutputFilter outputFilter = new NullOutputFilter(); + private ExecOutputFilter loggerFilter = new NullOutputFilter(); + + @Deprecated private ExecOutputFilter fileFilter = new NullOutputFilter(); private List output = new ArrayList<>(); + + @Deprecated private File logFile; public ExecOutputStream() { - this.outputFilter = new NullOutputFilter(); - this.loggerFilter = new NullOutputFilter(); + this.logger = LoggerFactory.getLogger(getClass()); } public ExecOutputStream(ExecOutputFilter outputFilter, ExecOutputFilter loggerFilter) { + this.logger = LoggerFactory.getLogger(getClass()); this.outputFilter = outputFilter; this.loggerFilter = loggerFilter; } + public void setLogger(Logger logger) { + this.logger = logger; + } + public ExecOutputFilter getOutputFilter() { return outputFilter; } @@ -55,10 +63,12 @@ public void setLoggerFilter(ExecOutputFilter loggerFilter) { this.loggerFilter = loggerFilter; } + @Deprecated public ExecOutputFilter getFileFilter() { return fileFilter; } + @Deprecated public void setFileFilter(ExecOutputFilter fileFilter) { this.fileFilter = fileFilter; } @@ -67,10 +77,12 @@ public List getOutput() { return output; } + @Deprecated public File getLogFile() { return logFile; } + @Deprecated public void setLogFile(File logFile) throws IOException { if (logFile == null) { this.logFile = null;