aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/security
diff options
context:
space:
mode:
authorAdam Domurad <[email protected]>2013-03-28 14:40:11 -0400
committerAdam Domurad <[email protected]>2013-03-28 14:40:11 -0400
commit30cfedc8f9d0fcaa0378005c9a0ca38930bf946b (patch)
tree374f8075602a274bab0c4deba711f9a67e277e94 /netx/net/sourceforge/jnlp/security
parent6bc87a67d88072fa2d701cf4e6a700893ee81e00 (diff)
Move normalizeUrlAndStripParams to UrlUtils
Diffstat (limited to 'netx/net/sourceforge/jnlp/security')
-rw-r--r--netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java23
1 files changed, 6 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");