com.atlassian.bamboo.utils
Class SystemProperty

java.lang.Object
  extended by com.atlassian.bamboo.utils.SystemProperty

public class SystemProperty
extends Object

This class represents system properties as constants.


Field Summary
static SystemProperty ANT_HOME
          Location of ANT
static SystemProperty BAMBOO_HOME_FROM_ENV
          Location of Bamboo Home
static SystemProperty DEFAULT_CVS_ROOT
          Default CVS Root (CVS server!)
static SystemProperty DEFAULT_P4_EXE
          Default Perforce p4 executable
static SystemProperty DEFAULT_PERFORCE_CLIENT
          Default Perforce Client
static SystemProperty DEFAULT_PERFORCE_PORT
          Default Perforce Port (Perforce server!)
static SystemProperty DEFAULT_PERFORCE_USER
          Default Perforce User
static SystemProperty MAVEN_HOME
          Location of MAVEN
static SystemProperty MAVEN2_HOME
          Location of MAVEN 2
 
Constructor Summary
  SystemProperty(String property, boolean mandatory)
          Creates an instance containing the value of the given property - logs an error if it cannot be found
protected SystemProperty(String property, boolean mandatory, Log logger)
          Used in testing
  SystemProperty(String property, String property2, boolean mandatory)
           
 
Method Summary
 boolean exists()
           
protected static String getEnvironmentVariable(String variable, boolean mandatory)
          Obtain the specified environment variable.
 String getValue()
          Obtain the value of this proprty
 boolean getValue(boolean defaultValue)
          Obtain the boolean property value
 String getValue(String defaultValue)
          Obtain the value of the property (returns the default value if the enviroment variable has not been defined.
static boolean isBuildDisabled()
           
static void setBuildDisabled(boolean buildDisabled)
           
 void setValue(String propertyValue)
          So the setting can be set by a test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BAMBOO_HOME_FROM_ENV

public static final SystemProperty BAMBOO_HOME_FROM_ENV
Location of Bamboo Home


MAVEN_HOME

public static final SystemProperty MAVEN_HOME
Location of MAVEN


MAVEN2_HOME

public static final SystemProperty MAVEN2_HOME
Location of MAVEN 2


ANT_HOME

public static final SystemProperty ANT_HOME
Location of ANT


DEFAULT_CVS_ROOT

public static final SystemProperty DEFAULT_CVS_ROOT
Default CVS Root (CVS server!)


DEFAULT_PERFORCE_PORT

public static final SystemProperty DEFAULT_PERFORCE_PORT
Default Perforce Port (Perforce server!)


DEFAULT_PERFORCE_CLIENT

public static final SystemProperty DEFAULT_PERFORCE_CLIENT
Default Perforce Client


DEFAULT_PERFORCE_USER

public static final SystemProperty DEFAULT_PERFORCE_USER
Default Perforce User


DEFAULT_P4_EXE

public static final SystemProperty DEFAULT_P4_EXE
Default Perforce p4 executable

Constructor Detail

SystemProperty

public SystemProperty(String property,
                      boolean mandatory)
Creates an instance containing the value of the given property - logs an error if it cannot be found

Parameters:
property - The property we're loading from the environment
mandatory - Is the property mandatory or optional?

SystemProperty

public SystemProperty(String property,
                      String property2,
                      boolean mandatory)

SystemProperty

protected SystemProperty(String property,
                         boolean mandatory,
                         Log logger)
Used in testing

Parameters:
property - The property we're loading from the environment
mandatory - Is the property mandatory or optional?
logger - The logger we're logging errors to
Method Detail

isBuildDisabled

public static boolean isBuildDisabled()

setBuildDisabled

public static void setBuildDisabled(boolean buildDisabled)

getValue

public String getValue()
Obtain the value of this proprty

Returns:
The value (null if the environment variable has not been defined)

getValue

public String getValue(String defaultValue)
Obtain the value of the property (returns the default value if the enviroment variable has not been defined.

Parameters:
defaultValue - The default value, if the environment variable has not been defined
Returns:
The value of the property

getValue

public boolean getValue(boolean defaultValue)
Obtain the boolean property value

Parameters:
defaultValue - The default value, if the environment variable has not been defined
Returns:
The value of the property

getEnvironmentVariable

protected static String getEnvironmentVariable(String variable,
                                               boolean mandatory)
Obtain the specified environment variable. An error is logged if a mandatory value does not exist.

Parameters:
variable - The variable we require
mandatory - Is this a mandatory property?
Returns:
The value of the variable, null if not found

setValue

public void setValue(String propertyValue)
So the setting can be set by a test

Parameters:
propertyValue - The value required by the test

exists

public boolean exists()


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.