Package net.sourceforge.cruisecontrol.util

Examples of net.sourceforge.cruisecontrol.util.StreamPumper


      LOG.debug(strbufferCmdLine.toString() + "\n");

      try {
        Process process = Runtime.getRuntime().exec(strbufferCmdLine.toString());
        new Thread(new StreamPumper(process.getInputStream())).start();
        new Thread(new StreamPumper(process.getErrorStream())).start();

        process.waitFor();

        process.getInputStream().close();
        process.getOutputStream().close();
View Full Code Here


    public void bootstrap() {
        try {
            Commandline commandLine = buildUpdateCommand();
            Process p = commandLine.execute();
            final boolean autoFlushOn = true;
            StreamPumper errorPumper =
                new StreamPumper(p.getErrorStream(), new PrintWriter(System.err, autoFlushOn));
            StreamPumper outPumper = new StreamPumper(p.getInputStream(), new PrintWriter(System.out, autoFlushOn));
            Thread errorPumperThread = new Thread(errorPumper);
            Thread outPumperThread = new Thread(outPumper);
            errorPumperThread.start();
            outPumperThread.start();
            p.waitFor();
View Full Code Here

        Commandline commandLine = buildUpdateCommand();

        log.debug("Executing: " + commandLine);
        try {
            Process p = Runtime.getRuntime().exec(commandLine.getCommandline());
            StreamPumper errorPumper =
                new StreamPumper(p.getErrorStream(), new PrintWriter(System.err, true));
            new Thread(errorPumper).start();
            p.waitFor();
            p.getInputStream().close();
            p.getOutputStream().close();
            p.getErrorStream().close();
View Full Code Here

        return changelistNumbers;
    }

    private void getRidOfLeftoverData(InputStream stream) {
        StreamPumper outPumper = new StreamPumper(stream, (PrintWriter) null);
        new Thread(outPumper).start();
    }
View Full Code Here

        return users;
    }

    private void logErrorStream(InputStream is) {
        StreamPumper errorPumper = new StreamPumper(is, new PrintWriter(System.err, true));
        new Thread(errorPumper).start();
    }
View Full Code Here

        LOG.debug("Command to execute : " + command);
        List modifications = null;
        try {
            Process p = Runtime.getRuntime().exec(command, null, root);

            StreamPumper errorPumper = new StreamPumper(p.getErrorStream());
            new Thread(errorPumper).start();

            InputStream input = p.getInputStream();
            modifications = parseStream(input);
View Full Code Here

        LOG.debug("jini startup command: " + Arrays.asList(cmdLine.getCommandline()));
        final Process newJiniProcess = Runtime.getRuntime().exec(cmdLine.getCommandline());

        // show what's happening with the jiniProcess
        new Thread(new StreamPumper(newJiniProcess.getErrorStream(),
                new PrefixedPrintWriter("[JiniErr] "))).start();
        new Thread(new StreamPumper(newJiniProcess.getInputStream(),
                new PrefixedPrintWriter("[JiniOut] "))).start();

        // setup security policy
        URL policyFile = ClassLoader.getSystemClassLoader().getResource(INSECURE_POLICY_FILENAME);
        assertNotNull("Can't load policy file resource: " + INSECURE_POLICY_FILENAME
View Full Code Here

TOP

Related Classes of net.sourceforge.cruisecontrol.util.StreamPumper

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.