changeset 1023:a0f97e180e2a

Fixed case when already decoded file is wonted from cache (RH1154177) netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (getCacheFile) if all previous attempts to get cached file, plain url.getPath is tried.
author Jiri Vanek <jvanek@redhat.com>
date Thu, 23 Oct 2014 13:12:39 +0200
parents bfc8902c347a
children 0dcef5344b23
files ChangeLog netx/net/sourceforge/jnlp/cache/ResourceTracker.java
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Oct 17 11:51:59 2014 +0200
+++ b/ChangeLog	Thu Oct 23 13:12:39 2014 +0200
@@ -1,3 +1,9 @@
+2014-10-21  Jiri Vanek  <jvanek@redhat.com>
+
+	Fixed case when already decoded file is wonted from cache (RH1154177)
+	* netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (getCacheFile) if
+	all previous attempts to get cached file, plain url.getPath is tried.
+
 2014-10-17  Jiri Vanek  <jvanek@redhat.com>
 
 	Fixed jdk8 javadoc generation error
--- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java	Fri Oct 17 11:51:59 2014 +0200
+++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java	Thu Oct 23 13:12:39 2014 +0200
@@ -395,8 +395,18 @@
 
             if (location.getProtocol().equalsIgnoreCase("file")) {
                 File file = UrlUtils.decodeUrlAsFile(location);
-                if (file.exists())
+                if (file.exists()) {
                     return file;
+                }
+                // try plain, not decoded file now
+                // sometimes the jnlp app developers are encoding for us
+                // so we end up encoding already encoded file. See RH1154177
+                file = new File(location.getPath());
+                if (file.exists()) {
+                    return file;
+                }
+                // have it sense to try also filename with whole query here?
+                // => location.getFile() ?
             }
 
             return null;