Class JARDesc
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.jnlp.element.resource.JARDesc
-
public class JARDesc extends java.lang.ObjectThe JAR element. This class is immutable and thread safe- Version:
- $Revision: 1.6 $
-
-
Field Summary
Fields Modifier and Type Field Description private booleancacheablewhether the JAR can be cachedstatic java.lang.StringDOWNLOAD_ATTRIBUTEstatic java.lang.StringHREF_ATTRIBUTEprivate booleanlazywhether to load the JAR on demandprivate java.net.URLlocationthe location of the JAR fileprivate booleanmainwhether the JAR contains the main classstatic java.lang.StringMAIN_ATTRIBUTEprivate booleannativeJarwhether the JAR contains native librariesprivate java.lang.Stringpartthe part namestatic java.lang.StringPART_ATTRIBUTEprivate VersionStringversionThe required JAR version.static java.lang.StringVERSION_ATTRIBUTE
-
Constructor Summary
Constructors Constructor Description JARDesc(java.net.URL location, VersionString version, java.lang.String part, boolean lazy, boolean main, boolean nativeJar, boolean cacheable)Create a JAR descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URLgetLocation()java.lang.StringgetPart()VersionStringgetVersion()booleanisCacheable()Returns if this jar is cacheablebooleanisEager()booleanisLazy()booleanisMain()booleanisNative()voidsetVersion(VersionString version)
-
-
-
Field Detail
-
HREF_ATTRIBUTE
public static final java.lang.String HREF_ATTRIBUTE
- See Also:
- Constant Field Values
-
VERSION_ATTRIBUTE
public static final java.lang.String VERSION_ATTRIBUTE
- See Also:
- Constant Field Values
-
MAIN_ATTRIBUTE
public static final java.lang.String MAIN_ATTRIBUTE
- See Also:
- Constant Field Values
-
DOWNLOAD_ATTRIBUTE
public static final java.lang.String DOWNLOAD_ATTRIBUTE
- See Also:
- Constant Field Values
-
PART_ATTRIBUTE
public static final java.lang.String PART_ATTRIBUTE
- See Also:
- Constant Field Values
-
location
private final java.net.URL location
the location of the JAR file
-
version
private VersionString version
The required JAR version. The version attribute can specify an exact version or a list of versions (version string). See JSR-56, section 3.4 for details.
-
part
private final java.lang.String part
the part name
-
lazy
private final boolean lazy
whether to load the JAR on demand
-
main
private final boolean main
whether the JAR contains the main class
-
nativeJar
private final boolean nativeJar
whether the JAR contains native libraries
-
cacheable
private final boolean cacheable
whether the JAR can be cached
-
-
Constructor Detail
-
JARDesc
public JARDesc(java.net.URL location, VersionString version, java.lang.String part, boolean lazy, boolean main, boolean nativeJar, boolean cacheable)Create a JAR descriptor.- Parameters:
location- the location of the JAR fileversion- the required JAR versions, or nullpart- the part name, or nulllazy- whether to load the JAR on demandmain- whether the JAR contains the main classnativeJar- whether the JAR contains native librariescacheable- whether the JAR can be cached or not
-
-
Method Detail
-
getLocation
public java.net.URL getLocation()
- Returns:
- the URL of the JAR file.
-
getVersion
public VersionString getVersion()
- Returns:
- the required version of the JAR file.
-
setVersion
public void setVersion(VersionString version)
-
getPart
public java.lang.String getPart()
- Returns:
- the part name, or null if not specified in the JNLP file.
-
isNative
public boolean isNative()
- Returns:
- true if the JAR file contains native code libraries.
-
isEager
public boolean isEager()
- Returns:
- true if the JAR file should be downloaded before starting the application.
-
isLazy
public boolean isLazy()
- Returns:
- true if the JAR file should be downloaded on demand.
-
isMain
public boolean isMain()
- Returns:
- true if the JNLP file defined this JAR as containing the main class. If no JARs were defined as the main JAR then the first JAR should be used to locate the main class.
- See Also:
ResourcesDesc.getMainJAR(net.adoptopenjdk.icedteaweb.jnlp.element.resource.JARDesc[])
-
isCacheable
public boolean isCacheable()
Returns if this jar is cacheable- Returns:
- Whether or not this jar is cacheable
-
-