diff options
author | Adam Domurad <[email protected]> | 2013-04-26 12:44:48 -0400 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2013-04-26 12:44:48 -0400 |
commit | 1970f53722f544819fd7b00698c79785c79b3df9 (patch) | |
tree | ba16cc19be024896f96efd1b4793f820261d88f1 /netx/net/sourceforge/jnlp/util | |
parent | bb0ced031fcb71d5d93d0a87744689444c5bd948 (diff) |
Decode local-file URLs leniently
Diffstat (limited to 'netx/net/sourceforge/jnlp/util')
-rw-r--r-- | netx/net/sourceforge/jnlp/util/UrlUtils.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/netx/net/sourceforge/jnlp/util/UrlUtils.java b/netx/net/sourceforge/jnlp/util/UrlUtils.java index d9d6866..af36a9c 100644 --- a/netx/net/sourceforge/jnlp/util/UrlUtils.java +++ b/netx/net/sourceforge/jnlp/util/UrlUtils.java @@ -37,6 +37,7 @@ exception statement from your version. package net.sourceforge.jnlp.util; +import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; @@ -134,4 +135,8 @@ public class UrlUtils { return normalizeUrlQuietly(url, false); } + /* Decode a URL as a file, being tolerant of URLs with mixed encoded & decoded portions. */ + public static File decodeUrlAsFile(URL url) { + return new File(decodeUrlQuietly(url).getFile()); + } } |