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)' ++ --- .../com/jogamp/common/util/cache/TempJarCache.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/java/com/jogamp/common/util/cache') diff --git a/src/java/com/jogamp/common/util/cache/TempJarCache.java b/src/java/com/jogamp/common/util/cache/TempJarCache.java index b17dd52..4c505f9 100644 --- a/src/java/com/jogamp/common/util/cache/TempJarCache.java +++ b/src/java/com/jogamp/common/util/cache/TempJarCache.java @@ -206,8 +206,10 @@ public class TempJarCache { * @param jarURI * @throws IOException if the jarURI could not be loaded or a previous load attempt failed * @throws SecurityException + * @throws URISyntaxException + * @throws IllegalArgumentException */ - public synchronized static final void addNativeLibs(Class certClass, URI jarURI) throws IOException, SecurityException { + public synchronized static final void addNativeLibs(Class certClass, URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException { final LoadState nativeLibJarsLS = nativeLibJars.get(jarURI); if( !testLoadState(nativeLibJarsLS, LoadState.LOOKED_UP) ) { nativeLibJars.put(jarURI, LoadState.LOOKED_UP); @@ -233,8 +235,10 @@ public class TempJarCache { * @param jarURI * @throws IOException if the jarURI could not be loaded or a previous load attempt failed * @throws SecurityException + * @throws URISyntaxException + * @throws IllegalArgumentException */ - public synchronized static final void addClasses(Class certClass, URI jarURI) throws IOException, SecurityException { + public synchronized static final void addClasses(Class certClass, URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException { final LoadState classFileJarsLS = classFileJars.get(jarURI); if( !testLoadState(classFileJarsLS, LoadState.LOOKED_UP) ) { classFileJars.put(jarURI, LoadState.LOOKED_UP); @@ -259,8 +263,10 @@ public class TempJarCache { * @return * @throws IOException if the jarURI could not be loaded or a previous load attempt failed * @throws SecurityException + * @throws URISyntaxException + * @throws IllegalArgumentException */ - public synchronized static final void addResources(Class certClass, URI jarURI) throws IOException, SecurityException { + public synchronized static final void addResources(Class certClass, URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException { final LoadState resourceFileJarsLS = resourceFileJars.get(jarURI); if( !testLoadState(resourceFileJarsLS, LoadState.LOOKED_UP) ) { resourceFileJars.put(jarURI, LoadState.LOOKED_UP); @@ -288,8 +294,10 @@ public class TempJarCache { * @param jarURI * @throws IOException if the jarURI could not be loaded or a previous load attempt failed * @throws SecurityException + * @throws URISyntaxException + * @throws IllegalArgumentException */ - public synchronized static final void addAll(Class certClass, URI jarURI) throws IOException, SecurityException { + public synchronized static final void addAll(Class certClass, URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException { checkInitialized(); if(null == jarURI) { throw new IllegalArgumentException("jarURI is null"); @@ -400,9 +408,11 @@ public class TempJarCache { * * @throws IOException * @throws SecurityException + * @throws URISyntaxException + * @throws IllegalArgumentException */ public synchronized static final void bootstrapNativeLib(Class certClass, String libBaseName, URI jarURI) - throws IOException, SecurityException { + throws IOException, SecurityException, IllegalArgumentException, URISyntaxException { checkInitialized(); boolean ok = false; int countEntries = 0; -- cgit v1.2.3