summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/common/net')
-rw-r--r--src/java/com/jogamp/common/net/AssetURLContext.java6
-rw-r--r--src/java/com/jogamp/common/net/Uri.java12
2 files changed, 13 insertions, 5 deletions
diff --git a/src/java/com/jogamp/common/net/AssetURLContext.java b/src/java/com/jogamp/common/net/AssetURLContext.java
index af90c01..8462a41 100644
--- a/src/java/com/jogamp/common/net/AssetURLContext.java
+++ b/src/java/com/jogamp/common/net/AssetURLContext.java
@@ -164,7 +164,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
url = new URL(path);
conn = open(url);
type = null != conn ? 1 : -1;
- } catch(final MalformedURLException e1) { if(DEBUG) { System.err.println("ERR(0): "+e1.getMessage()); } }
+ } catch(final MalformedURLException e1) { if(DEBUG) { System.err.println("FAIL(1): "+e1.getMessage()); } }
if(null == conn && null != cl) {
// lookup via ClassLoader .. cleanup leading '/'
@@ -189,7 +189,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
conn = open(url);
type = null != conn ? 3 : -1;
}
- } catch (final Throwable e) { if(DEBUG) { System.err.println("ERR(1): "+e.getMessage()); } }
+ } catch (final Throwable e) { if(DEBUG) { System.err.println("FAIL(3): "+e.getMessage()); } }
}
if(DEBUG) {
@@ -209,7 +209,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
final URLConnection c = url.openConnection();
c.connect(); // redundant
return c;
- } catch (final IOException ioe) { if(DEBUG) { System.err.println("ERR: "+ioe.getMessage()); } }
+ } catch (final IOException ioe) { if(DEBUG) { System.err.println("FAIL(2): "+ioe.getMessage()); } }
return null;
}
diff --git a/src/java/com/jogamp/common/net/Uri.java b/src/java/com/jogamp/common/net/Uri.java
index 6bafba2..bca90bf 100644
--- a/src/java/com/jogamp/common/net/Uri.java
+++ b/src/java/com/jogamp/common/net/Uri.java
@@ -1232,7 +1232,15 @@ 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.
+ * @since 2.3.2
+ */
+ public final boolean isJarScheme() {
+ return null != scheme && JAR_SCHEME.equals( scheme.get() );
}
/**
@@ -1386,7 +1394,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");