diff options
author | Denis Lila <[email protected]> | 2011-03-04 18:16:07 -0500 |
---|---|---|
committer | Denis Lila <[email protected]> | 2011-03-04 18:16:07 -0500 |
commit | aeb8dbac97efe7dec9452a406c8b93e1eeef07cf (patch) | |
tree | f25962b7d21441f232a243d39e80a4c74423f58d /netx/net/sourceforge/jnlp/JNLPFile.java | |
parent | ec6d0386718421e0c86a1c49feb3a227452da24b (diff) |
Fix PR658
Diffstat (limited to 'netx/net/sourceforge/jnlp/JNLPFile.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/JNLPFile.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/netx/net/sourceforge/jnlp/JNLPFile.java b/netx/net/sourceforge/jnlp/JNLPFile.java index 1bee246..2596c47 100644 --- a/netx/net/sourceforge/jnlp/JNLPFile.java +++ b/netx/net/sourceforge/jnlp/JNLPFile.java @@ -645,4 +645,32 @@ public class JNLPFile { return newVMArgs; } + /** + * XXX: this method does a "==" comparison between the input JARDesc and + * jars it finds through getResourcesDescs(). If ever the implementation + * of that function should change to return copies of JARDescs objects, + * then the "jar == aJar" comparison below should change accordingly. + * @param jar: the jar whose download options to get. + * @return the download options. + */ + public DownloadOptions getDownloadOptionsForJar(JARDesc jar) { + boolean usePack = false; + boolean useVersion = false; + ResourcesDesc[] descs = getResourcesDescs(); + for (ResourcesDesc desc: descs) { + JARDesc[] jars = desc.getJARs(); + for (JARDesc aJar: jars) { + if (jar == aJar/*jar.getLocation().equals(aJar.getLocation())*/) { + if (Boolean.valueOf(desc.getPropertiesMap().get("jnlp.packEnabled"))) { + usePack = true; + } + if (Boolean.valueOf(desc.getPropertiesMap().get("jnlp.versionEnabled"))) { + useVersion = true; + } + } + } + } + return new DownloadOptions(usePack, useVersion); + } + } |