From b98825eb7cfb61aead4a7dff57471cd2d2c26823 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 9 Jun 2013 05:33:16 +0200 Subject: Fix Bug 683 part1: IOUtil, JarUtil, TempJarCache, .. uses URI instead of URL to remove DNS Lookups etc .. --- .../com/jogamp/common/jvm/JNILibLoaderBase.java | 41 +++++++++++----------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'src/java/com/jogamp/common/jvm/JNILibLoaderBase.java') diff --git a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java index d0d8003..5621396 100644 --- a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java +++ b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java @@ -42,7 +42,8 @@ package com.jogamp.common.jvm; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.net.URL; +import java.net.URI; +import java.net.URISyntaxException; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Arrays; @@ -145,23 +146,23 @@ public class JNILibLoaderBase { loaderAction = action; } - /* pp */ static final boolean addNativeJarLibsImpl(Class classFromJavaJar, URL classJarURL, String nativeJarBasename, StringBuilder msg) - throws IOException, IllegalArgumentException, SecurityException + /* pp */ static final boolean addNativeJarLibsImpl(Class classFromJavaJar, URI classJarURI, String nativeJarBasename, StringBuilder msg) + throws IOException, SecurityException, URISyntaxException { msg.setLength(0); // reset - msg.append("addNativeJarLibsImpl(classFromJavaJar ").append(classFromJavaJar).append(", classJarURL ").append(classJarURL).append(", nativeJarBaseName ").append(nativeJarBasename).append("): "); + msg.append("addNativeJarLibsImpl(classFromJavaJar ").append(classFromJavaJar).append(", classJarURI ").append(classJarURI).append(", nativeJarBaseName ").append(nativeJarBasename).append("): "); boolean ok = false; if(TempJarCache.isInitialized()) { final String nativeJarName = nativeJarBasename+"-natives-"+PlatformPropsImpl.os_and_arch+".jar"; msg.append(nativeJarName); - final URL jarUrlRoot = JarUtil.getURLDirname( JarUtil.getJarSubURL( classJarURL ) ); - msg.append(" + ").append(jarUrlRoot); - final URL nativeJarURL = JarUtil.getJarFileURL(jarUrlRoot, nativeJarName); - msg.append(" -> ").append(nativeJarURL); + final URI jarUriRoot = JarUtil.getURIDirname( JarUtil.getJarSubURI( classJarURI ) ); + msg.append(" + ").append(jarUriRoot); + final URI nativeJarURI = JarUtil.getJarFileURI(jarUriRoot, nativeJarName); + msg.append(" -> ").append(nativeJarURI); if(DEBUG) { System.err.println(msg.toString()); } - TempJarCache.addNativeLibs(classFromJavaJar, nativeJarURL); + TempJarCache.addNativeLibs(classFromJavaJar, nativeJarURI); ok = true; } return ok; @@ -169,7 +170,7 @@ public class JNILibLoaderBase { /** * Loads and adds a JAR file's native library to the TempJarCache.
- * The native library JAR file's URL is derived as follows: + * The native library JAR file's URI is derived as follows: *