aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util/cache/TempJarCache.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-06-19 04:44:14 +0200
committerSven Gothel <[email protected]>2013-06-19 04:44:14 +0200
commit4376174ad35fdaf76f59430328582e913f468674 (patch)
treeeb1faa41eb440b1fec0c5f9932007050e5bd7e8b /src/java/com/jogamp/common/util/cache/TempJarCache.java
parent88dca02541d96f68a892ae7824e9e1b29793ae55 (diff)
Fix Bug 757: Regression of URL to URI conversion (Encoded path not compatible w/ file scheme.
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)' ++
Diffstat (limited to 'src/java/com/jogamp/common/util/cache/TempJarCache.java')
-rw-r--r--src/java/com/jogamp/common/util/cache/TempJarCache.java20
1 files changed, 15 insertions, 5 deletions
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 <code>jarURI</code> 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 <code>jarURI</code> 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 <code>jarURI</code> 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 <code>jarURI</code> 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;