com.atlassian.bamboo.configuration
Class Jdk

java.lang.Object
  extended by com.atlassian.bamboo.configuration.Jdk

public class Jdk
extends java.lang.Object

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


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 getHomeDirectory()
           
 java.lang.String getLabel()
           
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, 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?

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.

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

getLabel

public java.lang.String getLabel()

getHomeDirectory

public java.lang.String getHomeDirectory()


Copyright © 2011 Atlassian. All Rights Reserved.