Examples of StreamConsumer


Examples of org.codehaus.plexus.util.cli.StreamConsumer

        } catch (Exception e1) {
            throw new MojoExecutionException("Could not create runtime jar", e1);
        }
        cmd.addArguments(args);

        StreamConsumer out = new StreamConsumer() {
            public void consumeLine(String line) {
                getLog().info(line);
            }
        };
        final StringBuilder b = new StringBuilder();
        StreamConsumer err = new StreamConsumer() {
            public void consumeLine(String line) {
                b.append(line);
                b.append("\n");
                getLog().warn(line);
            }
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

        cl.addArg(arg);
        arg = new Argument();
        arg.setValue(getPDFFileName());
        cl.addArg(arg);

        StreamConsumer out = new StreamConsumer() {
            public void consumeLine(String line) {
                getLog().info("[prince] " + line);
            }
        };
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

        //CommandLineUtils.StringStreamConsumer consumer = new CommandLineUtils.StringStreamConsumer();

        Writer writer = new FileWriter( output );

        StreamConsumer consumer = new WriterStreamConsumer( writer );

        int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, consumer );

        writer.flush();
View Full Code Here

Examples of org.eclipse.help.internal.browser.StreamConsumer

    String[] command = prepareCommand(path, url);

    try
    {
      pr = Runtime.getRuntime().exec(command);
      Thread outConsumer = new StreamConsumer(pr.getInputStream());
      outConsumer.setName("Custom browser adapter output reader");
      outConsumer.start();
      Thread errConsumer = new StreamConsumer(pr.getErrorStream());
      errConsumer.setName("Custom browser adapter error reader");
      errConsumer.start();
    } catch (Exception e)
    {
      PerlDebugPlugin.getDefault().logError(
        "CustomBrowser.errorLaunching " + path,
        e);
View Full Code Here

Examples of org.sonar.api.utils.command.StreamConsumer

    when(commandExecutor.execute(any(Command.class), any(StreamConsumer.class), any(StreamConsumer.class), anyLong())).thenAnswer(new Answer<Integer>() {

      @Override
      public Integer answer(InvocationOnMock invocation) throws Throwable {
        StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
        List<String> lines = IOUtils.readLines(getClass().getResourceAsStream("/blame.xml"), "UTF-8");
        for (String line : lines) {
          outConsumer.consumeLine(line);
        }
        return 0;
      }
    });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.