aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-11-28 12:50:12 +0100
committerSven Gothel <[email protected]>2013-11-28 12:50:12 +0100
commit67dd9498368f0250180528d4fa10a09854066fea (patch)
treed912a62139a600d5ef563bb773c79a51245797b6 /src/java/com
parent4c835f0337674a0181c43f448d44d961e27b2f54 (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')
-rw-r--r--src/java/com/jogamp/common/util/IOUtil.java6
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());
}
/**