diff options
author | Sven Gothel <[email protected]> | 2011-09-24 00:23:00 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-24 00:23:00 +0200 |
commit | b669435d277a10e6163034aba286ecccce013f69 (patch) | |
tree | cb9eda438ac5845db7b35a63bd510a25acb7ba61 /src/java/com | |
parent | c8cd39fbe077ebf0a4785750752135f26e4a94ab (diff) |
NativeLib: Fix OSX lib name detection; JarUtil extract: at copy entry, mkdir of parent if !exist
Diffstat (limited to 'src/java/com')
-rwxr-xr-x | src/java/com/jogamp/common/os/NativeLibrary.java | 4 | ||||
-rw-r--r-- | src/java/com/jogamp/common/util/JarUtil.java | 17 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java index 0c2e5f2..5597359 100755 --- a/src/java/com/jogamp/common/os/NativeLibrary.java +++ b/src/java/com/jogamp/common/os/NativeLibrary.java @@ -82,8 +82,8 @@ public class NativeLibrary implements DynamicLookupHelper { case MACOS: dynLink = new MacOSXDynamicLinkerImpl(); - prefixes = new String[] { "lib", "" }; - suffixes = new String[] { ".dylib", ".jnilib", "" }; + prefixes = new String[] { "lib" }; + suffixes = new String[] { ".dylib", ".jnilib" }; break; /* diff --git a/src/java/com/jogamp/common/util/JarUtil.java b/src/java/com/jogamp/common/util/JarUtil.java index c95ad29..67cb0ad 100644 --- a/src/java/com/jogamp/common/util/JarUtil.java +++ b/src/java/com/jogamp/common/util/JarUtil.java @@ -224,7 +224,7 @@ public class JarUtil { if (DEBUG) { System.err.println("JarUtil: extract: "+jarFile.getName()+" -> "+dest+ ", extractNativeLibraries "+extractNativeLibraries+ - ", extractClassFiles"+extractClassFiles+ + ", extractClassFiles "+extractClassFiles+ ", extractOtherFiles "+extractOtherFiles); } int num = 0; @@ -264,13 +264,26 @@ public class JarUtil { final boolean isRootEntry = entryName.indexOf('/') == -1 && entryName.indexOf(File.separatorChar) == -1; + if (DEBUG) { + System.err.println("JarUtil: JarEntry : isNativeLib " + isNativeLib + + ", isClassFile " + isClassFile + ", isDir " + isDir + + ", isRootEntry " + isRootEntry ); + } + final File destFile = new File(dest, entryName); if(isDir) { - destFile.mkdir(); if (DEBUG) { System.err.println("JarUtil: MKDIR: " + entryName + " -> " + destFile ); } + destFile.mkdir(); } else { + final File destFolder = new File(destFile.getParent()); + if(!destFolder.exists()) { + if (DEBUG) { + System.err.println("JarUtil: MKDIR (parent): " + entryName + " -> " + destFolder ); + } + destFolder.mkdir(); + } final InputStream in = new BufferedInputStream(jarFile.getInputStream(entry)); final OutputStream out = new BufferedOutputStream(new FileOutputStream(destFile)); int numBytes = -1; |