Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.ExecuteStreamHandler


            toExecute.createArgument().setValue("--rmsource");
        }

        toExecute.createArgument().setValue("SPECS/" + specFile);

        ExecuteStreamHandler streamhandler = null;
        OutputStream outputstream = null;
        OutputStream errorstream = null;
        if (error == null && output == null) {
            if (!quiet) {
                streamhandler = new LogStreamHandler(this, Project.MSG_INFO,
View Full Code Here


    protected ExecuteStreamHandler createStreamHandler() throws BuildException {
        // if we didn't specify a file, then use a screen report
        if (outFile == null) {
            return new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_ERR);
        }
        ExecuteStreamHandler handler = null;
        OutputStream out = null;
        try {
            out = new FileOutputStream(outFile);
            handler = new MAuditStreamHandler(this, out);
        } catch (IOException e) {
View Full Code Here

            throw new BuildException("Error reading temporary file: " + tmpFile, e);
        }
        FileOutputStream xmlStream = null;
        try {
            xmlStream = new FileOutputStream(outFile);
            ExecuteStreamHandler xmlHandler = new MMetricsStreamHandler(this, xmlStream);
            xmlHandler.setProcessOutputStream(tmpStream);
            xmlHandler.start();
            xmlHandler.stop();
        } catch (IOException e) {
            throw new BuildException("Error creating output file: " + outFile, e);
        } finally {
            if (xmlStream != null) {
                try {
View Full Code Here

    /** execute the command line */
    public void execute() throws BuildException {
        try {
            setUp();
            ExecuteStreamHandler handler = createStreamHandler();
            execute0(handler);
        } finally {
            cleanUp();
        }
    }
View Full Code Here

    /** execute the command line */
    public void execute() throws BuildException {
        try {
            setUp();
            ExecuteStreamHandler handler = createStreamHandler();
            _execute(handler);
        } finally {
            cleanUp();
        }
    }
View Full Code Here

        File dir = owner.getProject().getBaseDir();
        if (directory != null) {
            dir = directory;
        }

        ExecuteStreamHandler handler = new LogStreamHandler(owner,
                Project.MSG_INFO, Project.MSG_WARN);
        executable = new Execute(handler, null);
        executable.setAntRun(owner.getProject());
        executable.setWorkingDirectory(dir);
    }
View Full Code Here

            toExecute.createArgument().setValue("--rmsource");
        }

        toExecute.createArgument().setValue("SPECS/" + specFile);

        ExecuteStreamHandler streamhandler = null;
        OutputStream outputstream = null;
        OutputStream errorstream = null;
        if (error == null && output == null) {
            if (!quiet) {
                streamhandler = new LogStreamHandler(this, Project.MSG_INFO,
View Full Code Here

        final EOFAwareInputStream processOutputStream = eofAwareInputStreamFactory.create(process.getInputStream());
        final EOFAwareInputStream processErrorStream = eofAwareInputStreamFactory.create(process.getErrorStream());
        final Collection<EOFAwareInputStream> processStreams = asList(processOutputStream, processErrorStream);

        final ExecuteStreamHandler streamHandler = executeStreamHandlerFactory.create(processOutputStream, processErrorStream, process.getOutputStream());

        final ExecuteWatchdog watchdog = watchdogFactory.create(config);
        watchdog.start(process);

        return new ManagedProcess(process, destroyer, streamHandler, watchdog, processStreams, executorService);
View Full Code Here

        this.pumpStreamHandlerFactory = pumpStreamHandlerFactory;
    }

    public ExecuteStreamHandler create(final InputStream processOutputStream, final InputStream processErrorStream, final OutputStream processInputStream)
    {
        final ExecuteStreamHandler streamHandler = pumpStreamHandlerFactory.create();
        try
        {
            streamHandler.setProcessOutputStream(processOutputStream);
            streamHandler.setProcessErrorStream(processErrorStream);
            streamHandler.setProcessInputStream(processInputStream);
            streamHandler.start();
        }
        catch (IOException e)
        {
            // The ExecuteStreamHandler interface declares IOException on all the above methods, but the PumpStreamHandler implementation never throws them
            throw new BuildException(e);
View Full Code Here

            toExecute.createArgument().setValue("--rmsource");
        }

        toExecute.createArgument().setValue("SPECS/" + specFile);

        ExecuteStreamHandler streamhandler = null;
        OutputStream outputstream = null;
        OutputStream errorstream = null;
        if (error == null && output == null) {
            if (!quiet) {
                streamhandler = new LogStreamHandler(this, Project.MSG_INFO,
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.ExecuteStreamHandler

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.