aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/common')
-rw-r--r--src/java/com/jogamp/common/util/IOUtil.java36
-rw-r--r--src/java/com/jogamp/common/util/JarUtil.java20
2 files changed, 30 insertions, 26 deletions
diff --git a/src/java/com/jogamp/common/util/IOUtil.java b/src/java/com/jogamp/common/util/IOUtil.java
index 45cb6ec..537c3e9 100644
--- a/src/java/com/jogamp/common/util/IOUtil.java
+++ b/src/java/com/jogamp/common/util/IOUtil.java
@@ -451,7 +451,7 @@ public class IOUtil {
}
String uriS = uri.toString();
if( DEBUG ) {
- System.out.println("getURIDirname "+uri+", extForm: "+uriS);
+ System.err.println("getURIDirname "+uri+", extForm: "+uriS);
}
return new URI( getURIDirname(uriS) );
}
@@ -523,9 +523,13 @@ public class IOUtil {
final URI specificURI = isJar ? JarUtil.getJarSubURI(uri) : uri;
final boolean hasJarSubURI = specificURI != uri;
if( DEBUG ) {
- System.out.println("IOUtil.toURL.0: isJAR "+isJar+", hasSubURI "+hasJarSubURI+Platform.getNewline()+
- "\t, uri "+uri+Platform.getNewline()+
- "\t -> "+specificURI.toString());
+ System.err.println("IOUtil.toURL.0: isJAR "+isJar+", hasSubURI "+hasJarSubURI+PlatformPropsImpl.NEWLINE+
+ "\t, uri "+uri+PlatformPropsImpl.NEWLINE+
+ "\t str -> "+specificURI.toString()+PlatformPropsImpl.NEWLINE+
+ "\t ascii -> "+specificURI.toASCIIString()+PlatformPropsImpl.NEWLINE+
+ "\t path -> "+specificURI.getPath()+PlatformPropsImpl.NEWLINE+
+ "\t decoded.path -> "+decodeFromURI(specificURI.getPath())
+ );
}
int mode = 0;
if( IOUtil.FILE_SCHEME.equals( specificURI.getScheme() ) ) {
@@ -534,7 +538,7 @@ public class IOUtil {
f = new File(specificURI);
} catch(Exception iae) {
if( DEBUG ) {
- System.out.println("Catched "+iae.getClass().getSimpleName()+": new File("+specificURI+") failed: "+iae.getMessage());
+ System.err.println("Catched "+iae.getClass().getSimpleName()+": new File("+decodeFromURI(specificURI.getPath())+") failed: "+iae.getMessage());
iae.printStackTrace();
}
f = null;
@@ -558,18 +562,18 @@ public class IOUtil {
try {
final URI fUri = f.toURI();
final URL fUrl = fUri.toURL();
- System.out.println("IOUtil.toURL.1b: fUri "+fUri+Platform.getNewline()+
+ System.err.println("IOUtil.toURL.1b: fUri "+fUri+PlatformPropsImpl.NEWLINE+
"\t, fUrl "+fUrl);
} catch (Exception ee) {
- System.out.println("Catched "+ee.getClass().getSimpleName()+": f.toURI().toURL() failed: "+ee.getMessage());
+ System.err.println("Catched "+ee.getClass().getSimpleName()+": f.toURI().toURL() failed: "+ee.getMessage());
ee.printStackTrace();
}
}
if( !hasJarSubURI ) {
urlS = IOUtil.FILE_SCHEME+IOUtil.SCHEME_SEPARATOR+fPathUriS;
if( DEBUG ) {
- System.out.println("IOUtil.toURL.1: fPath "+fPath+Platform.getNewline()+
- "\t -> "+fPathUriS+Platform.getNewline()+
+ System.err.println("IOUtil.toURL.1: fPath "+fPath+PlatformPropsImpl.NEWLINE+
+ "\t -> "+fPathUriS+PlatformPropsImpl.NEWLINE+
"\t -> "+urlS);
}
url = new URL(urlS);
@@ -579,10 +583,10 @@ public class IOUtil {
final String post = isJar ? IOUtil.JAR_SCHEME_SEPARATOR + jarEntry : "";
urlS = uriSchema+IOUtil.SCHEME_SEPARATOR+IOUtil.FILE_SCHEME+IOUtil.SCHEME_SEPARATOR+fPathUriS+post;
if( DEBUG ) {
- System.out.println("IOUtil.toURL.2: fPath "+fPath+Platform.getNewline()+
- "\t -> "+fPathUriS+Platform.getNewline()+
- "\t, jarEntry "+jarEntry+Platform.getNewline()+
- "\t, post "+post+Platform.getNewline()+
+ System.err.println("IOUtil.toURL.2: fPath "+fPath+PlatformPropsImpl.NEWLINE+
+ "\t -> "+fPathUriS+PlatformPropsImpl.NEWLINE+
+ "\t, jarEntry "+jarEntry+PlatformPropsImpl.NEWLINE+
+ "\t, post "+post+PlatformPropsImpl.NEWLINE+
"\t -> "+urlS);
}
url = new URL(urlS);
@@ -590,7 +594,7 @@ public class IOUtil {
}
} catch (Exception mue) {
if( DEBUG ) {
- System.out.println("Catched "+mue.getClass().getSimpleName()+": new URL("+urlS+") failed: "+mue.getMessage());
+ System.err.println("Catched "+mue.getClass().getSimpleName()+": new URL("+urlS+") failed: "+mue.getMessage());
mue.printStackTrace();
}
}
@@ -602,13 +606,13 @@ public class IOUtil {
mode = 3;
} catch (Exception e) {
if( DEBUG ) {
- System.out.println("Catched "+e.getClass().getSimpleName()+": "+uri+".toURL() failed: "+e.getMessage());
+ System.err.println("Catched "+e.getClass().getSimpleName()+": "+uri+".toURL() failed: "+e.getMessage());
e.printStackTrace();
}
}
}
if( DEBUG ) {
- System.err.println("IOUtil.toURL.X: mode "+mode+", "+uri+Platform.getNewline()+
+ System.err.println("IOUtil.toURL.X: mode "+mode+", "+uri+PlatformPropsImpl.NEWLINE+
"\t -> "+url);
}
return url;
diff --git a/src/java/com/jogamp/common/util/JarUtil.java b/src/java/com/jogamp/common/util/JarUtil.java
index 41455b7..ac93427 100644
--- a/src/java/com/jogamp/common/util/JarUtil.java
+++ b/src/java/com/jogamp/common/util/JarUtil.java
@@ -154,12 +154,12 @@ public class JarUtil {
final URL _url = resolver.resolve( url );
uri = _url.toURI();
if(DEBUG) {
- System.out.println("getJarURI Resolver: "+url+"\n\t-> "+_url+"\n\t-> "+uri);
+ System.err.println("getJarURI Resolver: "+url+"\n\t-> "+_url+"\n\t-> "+uri);
}
} else {
uri = url.toURI();
if(DEBUG) {
- System.out.println("getJarURI Default "+url+"\n\t-> "+uri);
+ System.err.println("getJarURI Default "+url+"\n\t-> "+uri);
}
}
}
@@ -168,7 +168,7 @@ public class JarUtil {
throw new IllegalArgumentException("URI is not using scheme "+IOUtil.JAR_SCHEME+": <"+uri+">");
}
if(DEBUG) {
- System.out.println("getJarURI res: "+clazzBinName+" -> "+url+" -> "+uri);
+ System.err.println("getJarURI res: "+clazzBinName+" -> "+url+" -> "+uri);
}
return uri;
}
@@ -225,7 +225,7 @@ public class JarUtil {
throw new IllegalArgumentException("No Jar name in <"+classJarURI+">");
}
if(DEBUG) {
- System.out.println("getJarName res: "+uriS);
+ System.err.println("getJarName res: "+uriS);
}
return uriS;
}
@@ -289,7 +289,7 @@ public class JarUtil {
}
final String uriS2 = IOUtil.encodeToURI(uriS1);
if(DEBUG) {
- System.out.println("getJarSubURI res: "+classJarURI+" -> "+uriS0+" -> "+uriS1+" -> "+uriS2);
+ System.err.println("getJarSubURI res: "+classJarURI+" -> "+uriS0+" -> "+uriS1+" -> "+uriS2);
}
return new URI(uriS2);
}
@@ -366,7 +366,7 @@ public class JarUtil {
}
final URI uri = new URI(IOUtil.JAR_SCHEME, getJarSubURI(clazzBinName, cl).toString()+"!/", null);
if(DEBUG) {
- System.out.println("getJarFileURI res: "+uri);
+ System.err.println("getJarFileURI res: "+uri);
}
return uri;
}
@@ -450,11 +450,11 @@ public class JarUtil {
throw new IllegalArgumentException("null jarFileURI");
}
if(DEBUG) {
- System.out.println("getJarFile.0: "+jarFileURI.toString());
+ System.err.println("getJarFile.0: "+jarFileURI.toString());
}
final URL jarFileURL = IOUtil.toURL(jarFileURI);
if(DEBUG) {
- System.out.println("getJarFile.1: "+jarFileURL.toString());
+ System.err.println("getJarFile.1: "+jarFileURL.toString());
}
// final URL jarFileURL = jarFileURI.toURL(); // doesn't work due to encoded path even w/ file schema!
final URLConnection urlc = jarFileURL.openConnection();
@@ -462,12 +462,12 @@ public class JarUtil {
JarURLConnection jarConnection = (JarURLConnection)jarFileURL.openConnection();
JarFile jarFile = jarConnection.getJarFile();
if(DEBUG) {
- System.out.println("getJarFile res: "+jarFile.getName());
+ System.err.println("getJarFile res: "+jarFile.getName());
}
return jarFile;
}
if(DEBUG) {
- System.out.println("getJarFile res: NULL");
+ System.err.println("getJarFile res: NULL");
}
return null;
}