aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/net/Uri.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-10-03 11:44:02 +0200
committerSven Gothel <[email protected]>2015-10-03 11:44:02 +0200
commit026875dd5256051d4e3504f1d9b01f7ce2bb70ff (patch)
treed7d1bd386c870787ffcf737ca6baaeaa6f73ef11 /src/java/com/jogamp/common/net/Uri.java
parent48cef027ec727d3e03b78f577208d1ce10b705d1 (diff)
Bug 1243 - Fix IOUtil.cleanPathString(..) special case ; Allow IOUtil and Uri to handle relative path
Fix IOUtil.cleanPathString(..) special case: Special case '/a/./../b' -> '/b' requires to resolve './' before '../'. Allow IOUtil and Uri to handle relative path: - IOUtil.getParentOf(..) - IOUtil.cleanPathString(..) Handle cases: 'a/./../b' -> 'b' '.././b' -> '../b' - Uri: Handle null scheme
Diffstat (limited to 'src/java/com/jogamp/common/net/Uri.java')
-rw-r--r--src/java/com/jogamp/common/net/Uri.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/net/Uri.java b/src/java/com/jogamp/common/net/Uri.java
index 6bafba2..a6fd4fe 100644
--- a/src/java/com/jogamp/common/net/Uri.java
+++ b/src/java/com/jogamp/common/net/Uri.java
@@ -1232,7 +1232,12 @@ public class Uri {
/** Returns true, if this instance is a {@code file} {@code scheme}, otherwise false. */
public final boolean isFileScheme() {
- return FILE_SCHEME.equals( scheme.get() );
+ return null != scheme && FILE_SCHEME.equals( scheme.get() );
+ }
+
+ /** Returns true, if this instance is a {@code jar} {@code scheme}, otherwise false. */
+ public final boolean isJarScheme() {
+ return null != scheme && JAR_SCHEME.equals( scheme.get() );
}
/**
@@ -1386,7 +1391,7 @@ public class Uri {
if( !emptyString(schemeSpecificPart) ) {
final StringBuilder sb = new StringBuilder();
- if( scheme.equals(JAR_SCHEME) ) {
+ if( isJarScheme() ) {
final int idx = schemeSpecificPart.lastIndexOf(JAR_SCHEME_SEPARATOR);
if (0 > idx) {
throw new URISyntaxException(input.get(), "missing jar separator");