diff options
Diffstat (limited to 'netx/net')
-rw-r--r-- | netx/net/sourceforge/jnlp/JNLPFile.java | 6 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/PluginBridge.java | 3 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/cache/ResourceTracker.java | 6 |
3 files changed, 12 insertions, 3 deletions
diff --git a/netx/net/sourceforge/jnlp/JNLPFile.java b/netx/net/sourceforge/jnlp/JNLPFile.java index 2596c47..78fc60d 100644 --- a/netx/net/sourceforge/jnlp/JNLPFile.java +++ b/netx/net/sourceforge/jnlp/JNLPFile.java @@ -395,6 +395,8 @@ public class JNLPFile { * Returns the resources section of the JNLP file as viewed * through the default locale and the os.name and os.arch * properties. + * XXX: Before overriding this method or changing its implementation, + * read the comment in JNLPFile.getDownloadOptionsForJar(JARDesc). */ public ResourcesDesc[] getResourcesDescs() { return getResourcesDescs(defaultLocale, defaultOS, defaultArch); @@ -649,7 +651,7 @@ public class JNLPFile { * 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. + * then the "jar == aJar" comparison below should change accordingly. * @param jar: the jar whose download options to get. * @return the download options. */ @@ -660,7 +662,7 @@ public class JNLPFile { for (ResourcesDesc desc: descs) { JARDesc[] jars = desc.getJARs(); for (JARDesc aJar: jars) { - if (jar == aJar/*jar.getLocation().equals(aJar.getLocation())*/) { + if (jar == aJar) { if (Boolean.valueOf(desc.getPropertiesMap().get("jnlp.packEnabled"))) { usePack = true; } diff --git a/netx/net/sourceforge/jnlp/PluginBridge.java b/netx/net/sourceforge/jnlp/PluginBridge.java index b8f493a..942630b 100644 --- a/netx/net/sourceforge/jnlp/PluginBridge.java +++ b/netx/net/sourceforge/jnlp/PluginBridge.java @@ -154,6 +154,9 @@ public class PluginBridge extends JNLPFile { } } + /** + * {@inheritdoc } + */ @Override public DownloadOptions getDownloadOptionsForJar(JARDesc jar) { return new DownloadOptions(usePack, useVersion); diff --git a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java index 9e033cf..a09f1c5 100644 --- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java +++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java @@ -656,7 +656,11 @@ public class ResourceTracker { boolean packgz = "pack200-gzip".equals(contentEncoding) || realLocation.getPath().endsWith(".pack.gz"); boolean gzip = "gzip".equals(contentEncoding); - + + // It's important to check packgz first. If a stream is both + // pack200 and gz encoded, then con.getContentEncoding() could + // return ".gz", so if we check gzip first, we would end up + // treating a pack200 file as a jar file. if (packgz) { downloadLocation = new URL(downloadLocation.toString() + ".pack.gz"); } else if (gzip) { |