com.atlassian.bamboo.configuration
Class Jdk

java.lang.Object
  extended by com.atlassian.bamboo.configuration.LabelPathMap
      extended by com.atlassian.bamboo.configuration.Jdk
All Implemented Interfaces:
java.io.Serializable

public class Jdk
extends LabelPathMap

This class is a POJO holding the information about a system JDK.

See Also:
Serialized Form

Field Summary
static java.lang.String CAPABILITY_JDK_PREFIX
           
static java.lang.String CAPABILITY_JDK_TYPE
           
 
Constructor Summary
Jdk(java.lang.String label, java.lang.String homeDirectory)
           
 
Method Summary
static Jdk discoverDefaultJdk()
          For some reason, the system's JAVA_HOME is sometimes the Jdk's Jre directory.
 java.lang.String getUiSwitchName()
          Inform the UI to display the JDK options.
 boolean isAJdk()
          Does the given homeDirectory reference a JDK home?
 boolean isValid()
          Does this object reference a valid JDK?
 java.lang.String toString()
           
 
Methods inherited from class com.atlassian.bamboo.configuration.LabelPathMap
equals, getBuilder, getBuilderManager, getBuilderType, getHomeDirectory, getLabel, getName, hashCode, setBuilderManager, setBuilderType, setHomeDirectory, setLabel
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CAPABILITY_JDK_TYPE

public static final java.lang.String CAPABILITY_JDK_TYPE
See Also:
Constant Field Values

CAPABILITY_JDK_PREFIX

public static final java.lang.String CAPABILITY_JDK_PREFIX
See Also:
Constant Field Values
Constructor Detail

Jdk

public Jdk(java.lang.String label,
           java.lang.String homeDirectory)
Method Detail

isValid

public boolean isValid()
Does this object reference a valid JDK?

Overrides:
isValid in class LabelPathMap
Returns:
Does the homeDirectory contain bin/java and lib/tools.jar?

isAJdk

public boolean isAJdk()
Does the given homeDirectory reference a JDK home?

Returns:
true iff it contains a lib/tools.jar

getUiSwitchName

public java.lang.String getUiSwitchName()
Inform the UI to display the JDK options.

Overrides:
getUiSwitchName in class LabelPathMap
Returns:
The JDK UI switch css name

discoverDefaultJdk

public static Jdk discoverDefaultJdk()
For some reason, the system's JAVA_HOME is sometimes the Jdk's Jre directory.

If that's the case, we return the parent dir.

Returns:
The default system JDK

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.