diff options
author | Adam Domurad <[email protected]> | 2013-03-28 14:40:11 -0400 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2013-03-28 14:40:11 -0400 |
commit | 30cfedc8f9d0fcaa0378005c9a0ca38930bf946b (patch) | |
tree | 374f8075602a274bab0c4deba711f9a67e277e94 /netx/net/sourceforge/jnlp/util/UrlUtils.java | |
parent | 6bc87a67d88072fa2d701cf4e6a700893ee81e00 (diff) |
Move normalizeUrlAndStripParams to UrlUtils
Diffstat (limited to 'netx/net/sourceforge/jnlp/util/UrlUtils.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/util/UrlUtils.java | 17 |
1 files changed, 17 insertions, 0 deletions
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") && |