com.tek42.perforce.process
Class CmdLineExecutor

java.lang.Object
  extended by com.tek42.perforce.process.CmdLineExecutor
All Implemented Interfaces:
Executor

public class CmdLineExecutor
extends Object
implements Executor

Executes on the command line. This is not thread safe.

Author:
Mike Wille

Constructor Summary
CmdLineExecutor(Map<String,String> environment)
          Requires a map of environment variables (P4USER, P4CLIENT, P4PORT, etc)
 
Method Summary
 void close()
          Close down all open resources
 void exec(String[] args)
          Execute the specified command and its arguments
 InputStream getInputStream()
           
 OutputStream getOutputStream()
           
 Process getProcess()
          Useful for things like process.waitFor().
 BufferedReader getReader()
          Returns a BufferedReader for reading from the stdout/stderr of this process
 BufferedWriter getWriter()
          Returns a BufferedWriter for writing to the stdin of this process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmdLineExecutor

public CmdLineExecutor(Map<String,String> environment)
Requires a map of environment variables (P4USER, P4CLIENT, P4PORT, etc)

Parameters:
environment -
Method Detail

exec

public void exec(String[] args)
          throws PerforceException
Description copied from interface: Executor
Execute the specified command and its arguments

Specified by:
exec in interface Executor
Throws:
PerforceException

getReader

public BufferedReader getReader()
Description copied from interface: Executor
Returns a BufferedReader for reading from the stdout/stderr of this process

Specified by:
getReader in interface Executor
Returns:

getWriter

public BufferedWriter getWriter()
Description copied from interface: Executor
Returns a BufferedWriter for writing to the stdin of this process

Specified by:
getWriter in interface Executor
Returns:

close

public void close()
Description copied from interface: Executor
Close down all open resources

Specified by:
close in interface Executor

getProcess

public Process getProcess()
Useful for things like process.waitFor().

Returns:

getOutputStream

public OutputStream getOutputStream()
Specified by:
getOutputStream in interface Executor

getInputStream

public InputStream getInputStream()
Specified by:
getInputStream in interface Executor


Copyright © 2004-2012 Hudson. All Rights Reserved.