public class StandardVMType extends AbstractVMInstallType
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID_STANDARD_VM_TYPE |
Constructor and Description |
---|
StandardVMType() |
Modifier and Type | Method and Description |
---|---|
java.io.File |
detectInstallLocation()
Tries to detect an installed VM that matches this VM install type.
|
void |
disposeVMInstall(java.lang.String id)
Remove the VM associated with the given id from the set of VMs managed by
this VM type.
|
protected IVMInstall |
doCreateVMInstall(java.lang.String id)
Subclasses should return a new instance of the appropriate
IVMInstall subclass from this method. |
static java.io.File |
findJavaExecutable(java.io.File vmInstallLocation)
Starting in the specified VM install location, attempt to find the 'java' executable
file.
|
protected java.util.List |
gatherAllLibraries(java.lang.String[] dirPaths)
Returns a list of all zips and jars contained in the given directories.
|
protected java.io.File |
getDefaultEndorsedDirectory(java.io.File installLocation)
Returns the default location of the endorsed directory, based on the
given install location.
|
protected java.io.File |
getDefaultExtensionDirectory(java.io.File installLocation)
Returns the default location of the extension directory, based on the given
install location.
|
java.net.URL |
getDefaultJavadocLocation(java.io.File installLocation)
Returns a URL for the default jsdoc location of a VM installed at the
given home location, or
null if none. |
LibraryLocation[] |
getDefaultLibraryLocations(java.io.File installLocation)
NOTE: We do not add libraries from the "endorsed" directory explicitly, as
the bootpath contains these entries already (if they exist).
|
protected IPath |
getDefaultPackageRootPath() |
protected java.lang.String |
getDefaultRootPath() |
protected IPath |
getDefaultSystemLibrary(java.io.File javaHome)
Return an
IPath corresponding to the single library file containing the
standard JavaScript classes for most VMs version 1.2 and above. |
protected IPath |
getDefaultSystemLibrarySource(java.io.File libLocation)
Returns a path to the source attachment for the given libaray, or
an empty path if none.
|
java.lang.String |
getName()
Returns the display name of this VM type.
|
protected java.lang.String |
getVMVersion(java.io.File javaHome,
java.io.File javaExecutable)
Returns the version of the VM at the given location, with the given
executable.
|
protected java.lang.String[] |
parsePaths(java.lang.String paths) |
protected void |
setDefaultRootPath(java.lang.String defaultRootPath) |
IStatus |
validateInstallLocation(java.io.File javaHome)
Validates the given location of a VM installation.
|
createVMInstall, findVMInstall, findVMInstallByName, getId, getVMInstalls, setInitializationData
public static final java.lang.String ID_STANDARD_VM_TYPE
public static java.io.File findJavaExecutable(java.io.File vmInstallLocation)
File
object, otherwise return
null
.public java.lang.String getName()
IVMInstallType
protected IVMInstall doCreateVMInstall(java.lang.String id)
AbstractVMInstallType
IVMInstall
subclass from this method.doCreateVMInstall
in class AbstractVMInstallType
id
- The vm's id. The IVMInstall
instance that is created must
return id
from its getId()
method.
Must not be null
.null
.protected java.lang.String getVMVersion(java.io.File javaHome, java.io.File javaExecutable)
javaHome
- javaExecutable
- public java.io.File detectInstallLocation()
IVMInstallType
null
if they
can't assure that a given vm install matches this IVMInstallType.null
if unable
to locate an installed VM.protected IPath getDefaultSystemLibrary(java.io.File javaHome)
IPath
corresponding to the single library file containing the
standard JavaScript classes for most VMs version 1.2 and above.protected IPath getDefaultSystemLibrarySource(java.io.File libLocation)
libLocation
- protected IPath getDefaultPackageRootPath()
public LibraryLocation[] getDefaultLibraryLocations(java.io.File installLocation)
installLocation
- home locationinstallLocation
.org.eclipse.jdt.launching.IVMInstallType#getDefaultLibraryLocations(File)
protected java.util.List gatherAllLibraries(java.lang.String[] dirPaths)
dirPaths
- a list of absolute paths of directories to searchprotected java.io.File getDefaultExtensionDirectory(java.io.File installLocation)
null
if an extension directory is not supported.installLocation
- null
protected java.io.File getDefaultEndorsedDirectory(java.io.File installLocation)
null
if an endorsed directory is not supported.installLocation
- null
protected java.lang.String getDefaultRootPath()
protected void setDefaultRootPath(java.lang.String defaultRootPath)
public IStatus validateInstallLocation(java.io.File javaHome)
IVMInstallType
For example, an implementation might check whether the VM executable is present.
javaHome
- the root directory of a potential installation for
this type of VMprotected java.lang.String[] parsePaths(java.lang.String paths)
public void disposeVMInstall(java.lang.String id)
IVMInstallType
disposeVMInstall
in interface IVMInstallType
disposeVMInstall
in class AbstractVMInstallType
id
- the id of the VM to be disposed.public java.net.URL getDefaultJavadocLocation(java.io.File installLocation)
AbstractVMInstallType
null
if none. The default
implementation returns null
, subclasses must override as
appropriate.
Note, this method would ideally be added to IVMInstallType
,
but it would have been a breaking API change between 2.0 and 2.1. Thus,
it has been added to the abstract base class that VM install types should
subclass.
getDefaultJavadocLocation
in class AbstractVMInstallType
installLocation
- home locationnull
Copyright (c) IBM Corp. and others 2000, 2016. All Rights Reserved.