Package org.apache.tools.ant.util

Examples of org.apache.tools.ant.util.TeeOutputStream


                }
            });
    }

    private PrintStream createTeePrint(PrintStream ps1, PrintStream ps2) {
        return new PrintStream(new TeeOutputStream(ps1, ps2));
    }
View Full Code Here


                if ("out".equalsIgnoreCase(args[0])) {
                    os = System.out;
                } else if ("err".equalsIgnoreCase(args[0])) {
                    os = System.err;
                } else if ("both".equalsIgnoreCase(args[0])) {
                    os = new TeeOutputStream(System.out, System.err);
                }
            }
            if (os != null) {
                Thread t = new Thread(new StreamPumper(System.in, os, true));
                t.start();
View Full Code Here

                }
            });
    }

    private PrintStream createTeePrint(PrintStream ps1, PrintStream ps2) {
        return new PrintStream(new TeeOutputStream(ps1, ps2));
    }
View Full Code Here

    }

    private ByteArrayOutputStream executeCommand(Session session, String cmd)
        throws BuildException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        TeeOutputStream tee = new TeeOutputStream(out, new KeepAliveOutputStream(System.out));

        try {
            final ChannelExec channel;
            session.setTimeout((int) maxwait);
            /* execute the command */
 
View Full Code Here

        errorStreams();
        if (alwaysLog || outputStream == null) {
            OutputStream outputLog
                = new LogOutputStream(managingTask, Project.MSG_INFO);
            outputStream = (outputStream == null)
                ? outputLog : new TeeOutputStream(outputLog, outputStream);
        }
        if (alwaysLog || errorStream == null) {
            OutputStream errorLog
                = new LogOutputStream(managingTask, Project.MSG_WARN);
            errorStream = (errorStream == null)
                ? errorLog : new TeeOutputStream(errorLog, errorStream);
        }
        if ((outputFilterChains != null && outputFilterChains.size() > 0)
            || !(outputEncoding.equalsIgnoreCase(inputEncoding))) {
            try {
                LeadPipeInputStream snk = new LeadPipeInputStream();
View Full Code Here

                    + outputProperty, Project.MSG_VERBOSE);
            }
            //shield it from being closed by a filtering StreamPumper
            OutputStream keepAliveOutput = new KeepAliveOutputStream(baos);
            outputStream = (outputStream == null) ? keepAliveOutput
                : new TeeOutputStream(outputStream, keepAliveOutput);
        } else {
            baos = null;
        }
    }
View Full Code Here

                    Project.MSG_VERBOSE);
            }
            //shield it from being closed by a filtering StreamPumper
            OutputStream keepAliveError = new KeepAliveOutputStream(errorBaos);
            errorStream = (error == null || error.length == 0) ? keepAliveError
                : new TeeOutputStream(errorStream, keepAliveError);
        } else {
            errorBaos = null;
        }
    }
View Full Code Here

        char[] c = new char[logHead.length()];
        Arrays.fill(c, ' ');
        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;
    }
View Full Code Here

    private int run(String[] command, OutputStream out, OutputStream err) throws IOException {
        PumpStreamHandler psh;
        if (err == null) {
            psh = new PumpStreamHandler(out, bos);
        } else {
            psh = new PumpStreamHandler(out, new TeeOutputStream(err, bos));
        }

        Execute exe = new Execute(psh, null);

        exe.setAntRun(getProject());
View Full Code Here

                if (!showOutput) {
                    System.setOut(systemOut);
                    System.setErr(systemError);
                } else {
                    System.setOut(new PrintStream(
                                      new TeeOutputStream(savedOut, systemOut)
                                      )
                                  );
                    System.setErr(new PrintStream(
                                      new TeeOutputStream(savedErr,
                                                          systemError)
                                      )
                                  );
                }
                perm = null;
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.util.TeeOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.