diff options
author | Sven Gothel <[email protected]> | 2013-11-28 12:50:12 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-11-28 12:50:12 +0100 |
commit | 67dd9498368f0250180528d4fa10a09854066fea (patch) | |
tree | d912a62139a600d5ef563bb773c79a51245797b6 /src/java/com/jogamp | |
parent | 4c835f0337674a0181c43f448d44d961e27b2f54 (diff) |
IOUtil.encodeToURI(): Only use method if required
Only use IOUtil.encodeToURI() if required,
i.e. 'new URI(String)' but not 'new URI(scheme, ...)' since the latter already encodes the path.
TestIOUtilURIHandling.test00BasicCoding() validates above findings.
Diffstat (limited to 'src/java/com/jogamp')
-rw-r--r-- | src/java/com/jogamp/common/util/IOUtil.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/java/com/jogamp/common/util/IOUtil.java b/src/java/com/jogamp/common/util/IOUtil.java index d6ef87a..bbda235 100644 --- a/src/java/com/jogamp/common/util/IOUtil.java +++ b/src/java/com/jogamp/common/util/IOUtil.java @@ -313,7 +313,7 @@ public class IOUtil { * @throws URISyntaxException if the resulting string does not comply w/ an RFC 2396 URI */ public static URI toURISimple(File file) throws URISyntaxException { - return new URI(FILE_SCHEME, null, encodeToURI(slashify(file.getAbsolutePath(), true /* startWithSlash */, file.isDirectory() /* endWithSlash */)), null); + return new URI(FILE_SCHEME, null, slashify(file.getAbsolutePath(), true /* startWithSlash */, file.isDirectory() /* endWithSlash */), null); } /** @@ -322,7 +322,7 @@ public class IOUtil { * @throws URISyntaxException if the resulting string does not comply w/ an RFC 2396 URI */ public static URI toURISimple(String protocol, String path, boolean isDirectory) throws URISyntaxException { - return new URI(protocol, null, encodeToURI(slashify(new File(path).getAbsolutePath(), true /* startWithSlash */, isDirectory /* endWithSlash */)), null); + return new URI(protocol, null, slashify(new File(path).getAbsolutePath(), true /* startWithSlash */, isDirectory /* endWithSlash */), null); } /** @@ -804,7 +804,7 @@ public class IOUtil { * @throws URISyntaxException if path is empty or has no parent directory available while resolving <code>../</code> */ public static URI getRelativeOf(URI baseURI, String relativePath) throws URISyntaxException { - return compose(baseURI.getScheme(), baseURI.getSchemeSpecificPart(), encodeToURI(relativePath), baseURI.getFragment()); + return compose(baseURI.getScheme(), baseURI.getSchemeSpecificPart(), relativePath, baseURI.getFragment()); } /** |