diff options
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 */ |