Class ExtensionDesc
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.jnlp.element.resource.ExtensionDesc
-
public class ExtensionDesc extends java.lang.ObjectThe extension element.- Version:
- $Revision: 1.8 $
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDOWNLOAD_ATTRIBUTEprivate java.util.List<java.lang.String>eagerExtPartseager ext partsstatic java.lang.StringEXT_DOWNLOAD_ELEMENTstatic java.lang.StringEXT_PART_ATTRIBUTEprivate java.util.Map<java.lang.String,java.lang.String>extToPartmap from ext-part to local partprivate JNLPFilefilethe JNLPFile the extension refers tostatic java.lang.StringHREF_ATTRIBUTEprivate java.net.URLlocationthe location of the extension JNLP fileprivate static LoggerLOGprivate java.lang.Stringnamethe extension namestatic java.lang.StringNAME_ATTRIBUTEstatic java.lang.StringPART_ATTRIBUTEprivate VersionStringversionThe required version.static java.lang.StringVERSION_ATTRIBUTE
-
Constructor Summary
Constructors Constructor Description ExtensionDesc(java.lang.String name, VersionString version, java.net.URL location)Create an extension descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPart(java.lang.String extPart, java.lang.String part, boolean lazy)Adds an extension part to be downloaded when the specified part of the main JNLP file is loaded.JNLPFilegetJNLPFile()java.net.URLgetLocation()java.lang.StringgetName()VersionStringgetVersion()voidresolve()Resolves the extension by creating a JNLPFile from the file specified by the extension's location property.
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
EXT_DOWNLOAD_ELEMENT
public static final java.lang.String EXT_DOWNLOAD_ELEMENT
- See Also:
- Constant Field Values
-
HREF_ATTRIBUTE
public static final java.lang.String HREF_ATTRIBUTE
- See Also:
- Constant Field Values
-
DOWNLOAD_ATTRIBUTE
public static final java.lang.String DOWNLOAD_ATTRIBUTE
- See Also:
- Constant Field Values
-
EXT_PART_ATTRIBUTE
public static final java.lang.String EXT_PART_ATTRIBUTE
- See Also:
- Constant Field Values
-
NAME_ATTRIBUTE
public static final java.lang.String NAME_ATTRIBUTE
- See Also:
- Constant Field Values
-
VERSION_ATTRIBUTE
public static final java.lang.String VERSION_ATTRIBUTE
- See Also:
- Constant Field Values
-
PART_ATTRIBUTE
public static final java.lang.String PART_ATTRIBUTE
- See Also:
- Constant Field Values
-
name
private final java.lang.String name
the extension name
-
version
private final VersionString version
The required version. The version attribute can specify an exact version or a list of versions (version string). See JSR-56, section 6.4 for details.
-
location
private final java.net.URL location
the location of the extension JNLP file
-
extToPart
private final java.util.Map<java.lang.String,java.lang.String> extToPart
map from ext-part to local part
-
eagerExtParts
private final java.util.List<java.lang.String> eagerExtParts
eager ext parts
-
file
private JNLPFile file
the JNLPFile the extension refers to
-
-
Constructor Detail
-
ExtensionDesc
public ExtensionDesc(java.lang.String name, VersionString version, java.net.URL location)Create an extension descriptor.- Parameters:
name- the extension nameversion- the required version of the JNLP file extensionlocation- the location of the JNLP file extension
-
-
Method Detail
-
addPart
public void addPart(java.lang.String extPart, java.lang.String part, boolean lazy)Adds an extension part to be downloaded when the specified part of the main JNLP file is loaded. The extension part will be downloaded before the application is launched if the lazy value is false or the part is empty or null.- Parameters:
extPart- the part name in the extension filepart- the part name in the main filelazy- whether to load the part before launching
-
getName
public java.lang.String getName()
- Returns:
- the name of the extension.
-
getVersion
public VersionString getVersion()
- Returns:
- the required version of the extension JNLP file.
-
getLocation
public java.net.URL getLocation()
- Returns:
- the location of the extension JNLP file.
-
resolve
public void resolve() throws ParseException, java.io.IOExceptionResolves the extension by creating a JNLPFile from the file specified by the extension's location property.- Throws:
java.io.IOException- if the extension JNLPFile could not be resolved.ParseException- if the extension JNLPFile could not be parsed or was not a component or installer descriptor.
-
getJNLPFile
public JNLPFile getJNLPFile()
- Returns:
- a JNLPFile for the extension, or null if the JNLP file has not been resolved.
-
-