Search in sources :

Example 1 with LazyFileOutputStream

use of org.apache.tools.ant.util.LazyFileOutputStream in project ant by apache.

the class Redirector method foldFiles.

private OutputStream foldFiles(final File[] file, final String logHead, final int loglevel, final boolean append, final boolean createEmptyFiles) {
    final OutputStream result = new LazyFileOutputStream(file[0], append, createEmptyFiles);
    managingTask.log(logHead + file[0], loglevel);
    final char[] c = new char[logHead.length()];
    Arrays.fill(c, ' ');
    final String indent = new String(c);
    for (int i = 1; i < file.length; i++) {
        outputStream = new TeeOutputStream(outputStream, new LazyFileOutputStream(file[i], append, createEmptyFiles));
        managingTask.log(indent + file[i], loglevel);
    }
    return result;
}
Also used : TeeOutputStream(org.apache.tools.ant.util.TeeOutputStream) LazyFileOutputStream(org.apache.tools.ant.util.LazyFileOutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) KeepAliveOutputStream(org.apache.tools.ant.util.KeepAliveOutputStream) OutputStream(java.io.OutputStream) LazyFileOutputStream(org.apache.tools.ant.util.LazyFileOutputStream) PipedOutputStream(java.io.PipedOutputStream) TeeOutputStream(org.apache.tools.ant.util.TeeOutputStream)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 OutputStream (java.io.OutputStream)1 PipedOutputStream (java.io.PipedOutputStream)1 KeepAliveOutputStream (org.apache.tools.ant.util.KeepAliveOutputStream)1 LazyFileOutputStream (org.apache.tools.ant.util.LazyFileOutputStream)1 TeeOutputStream (org.apache.tools.ant.util.TeeOutputStream)1