org.jenkinsci.plugins.darcs.cmd
Class DarcsCommand

java.lang.Object
  extended by org.jenkinsci.plugins.darcs.cmd.DarcsCommand

public class DarcsCommand
extends Object

Abstracts Darcs command.

Author:
Sven Strittmatter

Field Summary
private  ArgumentListBuilder args
          Argument list representing the command.
private  OutputStream err
          Records STDERR of command.
private  OutputStream out
          Records STDOUT of command.
 
Constructor Summary
DarcsCommand(ArgumentListBuilder args)
          Default constructor.
 
Method Summary
static DarcsCommandBuilder builder(String darcsExe)
          Main entry point to obtain a command builder.
 int execute(Launcher.ProcStarter proc)
          Executes the command by joining the passed in process starter.
(package private)  ArgumentListBuilder getArgs()
          Get the arguments.
 OutputStream getErr()
          Get output stream which records STDOUT.
 OutputStream getOut()
          Get output stream which records STDOUT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

args

private final ArgumentListBuilder args
Argument list representing the command.


out

private final OutputStream out
Records STDOUT of command.


err

private final OutputStream err
Records STDERR of command.

Constructor Detail

DarcsCommand

DarcsCommand(ArgumentListBuilder args)
Default constructor. Not instantiated outside of the builders.

Parameters:
args - generated argument list from a builder
Method Detail

builder

public static DarcsCommandBuilder builder(String darcsExe)
Main entry point to obtain a command builder.

Parameters:
darcsExe - name of Darcs executable, e.g. "darcs" or "/usr/local/bin/darcs"
Returns:
always new instance

execute

public int execute(Launcher.ProcStarter proc)
            throws IOException,
                   InterruptedException
Executes the command by joining the passed in process starter.

Parameters:
proc - used to join the command
Returns:
the return code of the executed command
Throws:
IOException - if there's an error launching/joining a process
InterruptedException - if a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity

getOut

public OutputStream getOut()
Get output stream which records STDOUT.

Returns:
reference to the output stream

getErr

public OutputStream getErr()
Get output stream which records STDOUT.

Returns:
reference to the output stream

getArgs

ArgumentListBuilder getArgs()
Get the arguments.

Returns:
reference of internal argument list object


Copyright © 2004-2013 weltraumschaf.de. All Rights Reserved.