diff options
author | Sven Gothel <[email protected]> | 2011-12-01 16:18:34 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-12-01 16:18:34 +0100 |
commit | 7e6cf46ed2e0e9772f79e06437596056efa8c682 (patch) | |
tree | 35e1155262be9e188bdbb7d64f24642d9914e6d3 /src/java/com/jogamp/common/util/cache/TempFileCache.java | |
parent | ae8f6b7ed095abe2ff2284211b40ba8720e2446f (diff) |
Refine TempJarCache/JNILibLoaderBase ; Add TempFileCache destroy() for instance.
JNILibLoaderBase's 'addNativeJarLibs(Class<?> classFromJavaJar, String allNativeJarBaseName, String[] atomicNativeJarBaseNames)'
now just attempts to load the 'all' variant, and will continue w/ atomics if not successful (ie not available).
It skips the validation of a 'allJavaJarPrefix', ie validating the 'classFromJavaJar holding JAR file,
which allows GLUEGEN/JOGL classes to be contained in JAR files other than the original.
Diffstat (limited to 'src/java/com/jogamp/common/util/cache/TempFileCache.java')
-rw-r--r-- | src/java/com/jogamp/common/util/cache/TempFileCache.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/java/com/jogamp/common/util/cache/TempFileCache.java b/src/java/com/jogamp/common/util/cache/TempFileCache.java index 4210a24..c3b24aa 100644 --- a/src/java/com/jogamp/common/util/cache/TempFileCache.java +++ b/src/java/com/jogamp/common/util/cache/TempFileCache.java @@ -393,10 +393,10 @@ public class TempFileCache { } } } - path.delete(); } + /** Create the <code>individualTmpDir</code>. */ public TempFileCache () { if (DEBUG) { System.err.println("TempFileCache: new TempFileCache() --------------------- (static ok: "+(!staticInitError)+")"); @@ -416,6 +416,25 @@ public class TempFileCache { } } + /** Delete the <code>individualTmpDir</code> recursively and remove it's reference. */ + public void destroy() { + if (DEBUG) { + System.err.println("TempFileCache: destroy() --------------------- (static ok: "+(!staticInitError)+")"); + System.err.println("TempFileCache: Thread: "+Thread.currentThread().getName()+", CL 0x"+Integer.toHexString(TempFileCache.class.getClassLoader().hashCode())+", this 0x"+Integer.toHexString(hashCode())); + } + if(!staticInitError) { + try { + removeAll(individualTmpDir); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + individualTmpDir = null; + if (DEBUG) { + System.err.println("TempFileCache: destroy() END"); + } + } + /** * @return true is static and object initialization was successful */ |