net.sourceforge.cruisecontrol.util
Class EnvCommandline

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.util.Commandline
      extended bynet.sourceforge.cruisecontrol.util.EnvCommandline
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AccurevCommandline, ManagedCommandline

public class EnvCommandline
extends Commandline

Extends the Commandline class to provide a means to manipulate the OS environment under which the command will run.

Author:
Robert J. Smith

Nested Class Summary
 
Nested classes inherited from class net.sourceforge.cruisecontrol.util.Commandline
Commandline.Argument, Commandline.Marker
 
Constructor Summary
EnvCommandline()
          Default constructor
EnvCommandline(java.lang.String command)
          Constructor which takes a command line string and attempts to parse it into it's various components.
 
Method Summary
 java.lang.Process execute()
          Executes the command.
 java.lang.String getVariable(java.lang.String var)
          Gets the value of an environment variable.
 void setVariable(java.lang.String var, java.lang.String value)
          Sets a variable within the environment under which the command will be run.
 
Methods inherited from class net.sourceforge.cruisecontrol.util.Commandline
addArguments, clear, clearArgs, clone, createArgument, createArgument, createArgument, createArguments, createMarker, executeAndWait, getArguments, getCommandline, getExecutable, getWorkingDir, getWorkingDirectory, quoteArgument, setExecutable, setWorkingDir, setWorkingDirectory, size, toString, toString, toString, toStringNoQuoting, translateCommandline, useSafeQuoting
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnvCommandline

public EnvCommandline(java.lang.String command)
Constructor which takes a command line string and attempts to parse it into it's various components.

Parameters:
command - The command

EnvCommandline

public EnvCommandline()
Default constructor

Method Detail

setVariable

public void setVariable(java.lang.String var,
                        java.lang.String value)
Sets a variable within the environment under which the command will be run.

Parameters:
var - The environment variable to set
value - The value of the variable

getVariable

public java.lang.String getVariable(java.lang.String var)
Gets the value of an environment variable. The variable name is case sensitive.

Parameters:
var - The variable for which you wish the value
Returns:
The value of the variable, or null if not found

execute

public java.lang.Process execute()
                          throws java.io.IOException
Executes the command.

Overrides:
execute in class Commandline
Throws:
java.io.IOException