From 4376174ad35fdaf76f59430328582e913f468674 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 19 Jun 2013 04:44:14 +0200 Subject: Fix Bug 757: Regression of URL to URI conversion (Encoded path not compatible w/ file scheme. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression of (Bug 683, Commit b98825eb7cfb61aead4a7dff57471cd2d2c26823). The URI encoded path cannot be read by File I/O (if file scheme), since the latter requests an UTF8/16 name, not an URI encoded name (i.e. %20 for space). The encoded URL is produced if calling 'uri.toURL()' and hence the new 'IOUtil.toURL(URI)' provides a custom conversion recovering the UTF name via 'new File(uri).getPath()'. Tested w/ - synthetic URI/URL coposition (unit test) - manual w/ moving 'build' to 'build öä lala' for gluegen, joal and jogl. +++ Misc.: - 'URI JarUtil.getURIDirname(URI)' -> 'URI IOUtil.getDirname(URI)' ++ --- src/java/com/jogamp/common/jvm/JNILibLoaderBase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (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 456c35a..2023162 100644 --- a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java +++ b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java @@ -52,6 +52,7 @@ import java.util.Iterator; import java.util.List; import com.jogamp.common.os.NativeLibrary; +import com.jogamp.common.util.IOUtil; import com.jogamp.common.util.JarUtil; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.cache.TempJarCache; @@ -155,7 +156,7 @@ public class JNILibLoaderBase { if(TempJarCache.isInitialized()) { final String nativeJarName = nativeJarBasename+"-natives-"+PlatformPropsImpl.os_and_arch+".jar"; msg.append(nativeJarName); - final URI jarUriRoot = JarUtil.getURIDirname( JarUtil.getJarSubURI( classJarURI ) ); + final URI jarUriRoot = IOUtil.getDirname( JarUtil.getJarSubURI( classJarURI ) ); msg.append(" + ").append(jarUriRoot); final URI nativeJarURI = JarUtil.getJarFileURI(jarUriRoot, nativeJarName); msg.append(" -> ").append(nativeJarURI); -- cgit v1.2.3