summaryrefslogtreecommitdiffstats
path: root/src/junit/com/jogamp/common/util/TestJarUtil.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-09-07 07:58:39 +0200
committerSven Gothel <[email protected]>2014-09-07 07:58:39 +0200
commit0b07f9107c5b033913f5c4cbeb906ae6dafc2d77 (patch)
treea2248c83cf9bb50721d195798fcb96a688224f31 /src/junit/com/jogamp/common/util/TestJarUtil.java
parent2faec846fbc13d206028b16a7713c7a1a701fa08 (diff)
Bug 908: Fix URI/URL double encoding, ensuring encoded/decoded variants are used properly (Added unit test)
Bug 908 was caused by confusing URI encoded parts (e.g. scheme-specific-part) and it's decoded variant. This especially happened due to: - the fact, that the encoded and unencoded variant uses the same String type, - the URI/URL decoding differs, is not complete (e.g. %20 .. SPACE remains in decoded part), - and does not comply w/ RFC 2396 and RFC 3986 (encoding), e.g. not all RESERVED chars are encoded. In branch 'v2.3.0_branch', we will introduce our own Uri and Uri.Encoded class to solve above issue by replacing all URI usage w/ Uri. - Backporting results of own Uri class introduction in branch 'v2.3.0_branch' - Ensure the encoded URI parts are used where required, i.e. IOUtil.compose(..) etc - TestNetIOURIReservedCharsBug908: Automated test, launching GlueGen jar file from an <i>odd pathname</i>.
Diffstat (limited to 'src/junit/com/jogamp/common/util/TestJarUtil.java')
-rw-r--r--src/junit/com/jogamp/common/util/TestJarUtil.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/junit/com/jogamp/common/util/TestJarUtil.java b/src/junit/com/jogamp/common/util/TestJarUtil.java
index 07e33fc..db5c268 100644
--- a/src/junit/com/jogamp/common/util/TestJarUtil.java
+++ b/src/junit/com/jogamp/common/util/TestJarUtil.java
@@ -99,7 +99,7 @@ public class TestJarUtil extends JunitTracer {
void validateJarFileURL(final URI jarFileURI) throws IllegalArgumentException, IOException, URISyntaxException {
Assert.assertNotNull(jarFileURI);
- final URL jarFileURL = IOUtil.toURL(jarFileURI);
+ final URL jarFileURL = jarFileURI.toURL();
final URLConnection aURLc = jarFileURL.openConnection();
Assert.assertTrue("jarFileURI/URL has zero content: "+jarFileURL, aURLc.getContentLength()>0);
System.err.println("URLConnection: "+aURLc);
@@ -116,7 +116,7 @@ public class TestJarUtil extends JunitTracer {
final URI jarSubURI = JarUtil.getJarSubURI(clazzBinName, cl);
Assert.assertNotNull(jarSubURI);
- final URL jarSubURL= IOUtil.toURL(jarSubURI);
+ final URL jarSubURL= jarSubURI.toURL();
final URLConnection urlConn = jarSubURL.openConnection();
Assert.assertTrue("jarSubURL has zero content: "+jarSubURL, urlConn.getContentLength()>0);
System.err.println("URLConnection of jarSubURL: "+urlConn);