com.tek42.perforce.process
Class CmdLineExecutor

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

public class CmdLineExecutor
extends java.lang.Object
implements Executor

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

Author:
Mike Wille

Constructor Summary
CmdLineExecutor(java.util.Map<java.lang.String,java.lang.String> environment)
          Requires a map of environment variables (P4USER, P4CLIENT, P4PORT, etc)
 
Method Summary
 void close()
          Close down all open resources
 void exec(java.lang.String[] args)
          Execute the specified command and its arguments
 java.lang.Process getProcess()
          Useful for things like process.waitFor().
 java.io.BufferedReader getReader()
          Returns a BufferedReader for reading from the stdout/stderr of this process
 java.io.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(java.util.Map<java.lang.String,java.lang.String> environment)
Requires a map of environment variables (P4USER, P4CLIENT, P4PORT, etc)

Parameters:
environment -
Method Detail

exec

public void exec(java.lang.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 java.io.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 java.io.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 java.lang.Process getProcess()
Useful for things like process.waitFor().

Returns:


Copyright © 2009. All Rights Reserved.