summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-24 00:23:00 +0200
committerSven Gothel <[email protected]>2011-09-24 00:23:00 +0200
commitb669435d277a10e6163034aba286ecccce013f69 (patch)
treecb9eda438ac5845db7b35a63bd510a25acb7ba61 /src/java/com/jogamp/common/util
parentc8cd39fbe077ebf0a4785750752135f26e4a94ab (diff)
NativeLib: Fix OSX lib name detection; JarUtil extract: at copy entry, mkdir of parent if !exist
Diffstat (limited to 'src/java/com/jogamp/common/util')
-rw-r--r--src/java/com/jogamp/common/util/JarUtil.java17
1 files changed, 15 insertions, 2 deletions
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;