diff options
Diffstat (limited to 'netx')
-rw-r--r-- | netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java | 23 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/util/UrlUtils.java | 17 |
2 files changed, 23 insertions, 17 deletions
diff --git a/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java b/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java index 26bc1d4..6139321 100644 --- a/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java +++ b/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java @@ -45,6 +45,8 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; + +import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.cache.ResourceTracker; @@ -96,24 +98,11 @@ public class UnsignedAppletTrustConfirmation { private static UnsignedAppletActionEntry getMatchingItem(UnsignedAppletActionStorage actionStorage, PluginBridge file) { return actionStorage.getMatchingItem( - normalizeUrlAndStripParams(file.getSourceLocation()).toString(), - normalizeUrlAndStripParams(file.getCodeBase()).toString(), + UrlUtils.normalizeUrlAndStripParams(file.getSourceLocation()).toString(), + UrlUtils.normalizeUrlAndStripParams(file.getCodeBase()).toString(), toRelativePaths(file.getArchiveJars(), file.getCodeBase().toString())); } - static URL normalizeUrlAndStripParams(URL url) { - try { - String[] urlParts = url.toString().split("\\?"); - URL strippedUrl = new URL(urlParts[0]); - return ResourceTracker.normalizeUrl(strippedUrl, false); - } catch (IOException e) { - e.printStackTrace(); - } catch (URISyntaxException e) { - e.printStackTrace(); - } - return url; - } - /* Extract the archives as relative paths */ static List<String> toRelativePaths(List<String> paths, String rootPath) { List<String> fileNames = new ArrayList<String>(); @@ -142,8 +131,8 @@ public class UnsignedAppletTrustConfirmation { return; } - URL codebase = normalizeUrlAndStripParams(file.getCodeBase()); - URL documentbase = normalizeUrlAndStripParams(file.getSourceLocation()); + URL codebase = UrlUtils.normalizeUrlAndStripParams(file.getCodeBase()); + URL documentbase = UrlUtils.normalizeUrlAndStripParams(file.getSourceLocation()); /* Else, create a new entry */ UrlRegEx codebaseRegex = new UrlRegEx("\\Q" + codebase + "\\E"); diff --git a/netx/net/sourceforge/jnlp/util/UrlUtils.java b/netx/net/sourceforge/jnlp/util/UrlUtils.java index 403b977..a043bb0 100644 --- a/netx/net/sourceforge/jnlp/util/UrlUtils.java +++ b/netx/net/sourceforge/jnlp/util/UrlUtils.java @@ -37,10 +37,27 @@ exception statement from your version. package net.sourceforge.jnlp.util; +import java.io.IOException; +import java.net.URISyntaxException; import java.net.URL; +import net.sourceforge.jnlp.cache.ResourceTracker; + public class UrlUtils { + public static URL normalizeUrlAndStripParams(URL url) { + try { + String[] urlParts = url.toString().split("\\?"); + URL strippedUrl = new URL(urlParts[0]); + return ResourceTracker.normalizeUrl(strippedUrl, false); + } catch (IOException e) { + e.printStackTrace(); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + return url; + } + public static boolean isLocalFile(URL url) { if (url.getProtocol().equals("file") && |