Class: JavaBuildpackUtils::Jre::SelectedJre

Inherits:
Object
  • Object
show all
Defined in:
lib/java-buildpack-utils/jre/selected_jre.rb

Overview

A class containing information about the JRE selected by the user.

Constant Summary collapse

DEFAULT_VENDOR =

The default JRE vendor

'oracle'
KEY_VENDOR =

The property key for specifying the vendor

'java.runtime.vendor'
DEFAULT_VERSION =

The default JRE version

'7'
KEY_VERSION =

The property key for specifying the version

'java.runtime.version'
JRES =

The collection of legal JREs

{
  openjdk: {
    J6: '',
    J7: '',
    J8: 'http://download.java.net/jdk8/archive/b88/binaries/jre-8-ea-bin-b88-linux-x64-02_may_2013.tar.gz'
  },
  oracle: {
    J6: '',
    J7: 'http://javadl.sun.com/webapps/download/AutoDL?BundleId=76853',
    J8: ''
  }
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_dir) ⇒ SelectedJre

Creates a new instance, passing in the application directory used during release

Parameters:

  • app_dir (String)

    The application to inspect for values specified by the user



59
60
61
62
63
64
65
66
67
# File 'lib/java-buildpack-utils/jre/selected_jre.rb', line 59

def initialize(app_dir)
  properties = system_properties(app_dir)


  @vendor = configured_vendor properties
  @version = configured_version properties
  @id = "java-#{@vendor}-#{@version}"
  @uri = JRES[@vendor.to_sym]["J#{@version}".to_sym]
end

Instance Attribute Details

#idString (readonly)

Returns a unique value indicating exactly which JRE is being used. The value is structured as ‘java-<vendor>-<version>’.

Returns:

  • (String)

    a unique value indicating exactly which JRE is being used. The value is structured as ‘java-<vendor>-<version>’



54
55
56
# File 'lib/java-buildpack-utils/jre/selected_jre.rb', line 54

def id
  @id
end

#uriString (readonly)

Returns the download URI for the JRE being used.

Returns:

  • (String)

    the download URI for the JRE being used



54
# File 'lib/java-buildpack-utils/jre/selected_jre.rb', line 54

attr_reader :id, :uri, :vendor, :version

#vendorString (readonly)

Returns the vendor for the JRE being used.

Returns:

  • (String)

    the vendor for the JRE being used



54
# File 'lib/java-buildpack-utils/jre/selected_jre.rb', line 54

attr_reader :id, :uri, :vendor, :version

#versionObject (readonly)

Returns the value of attribute version.



54
# File 'lib/java-buildpack-utils/jre/selected_jre.rb', line 54

attr_reader :id, :uri, :vendor, :version