From 1468286bf569a493e4fdb887d5f3732f88c8cec3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 16 Jun 2012 05:31:47 +0200 Subject: Fix Bug 587: Use alternative storage location if platform's temp directory is mounted w/ noexec ; IOUtil API change! Test whether executable files can be launched in temporary folder by trying to run an empty executable file - if !( WINDOWS | OPENKODE ) TempDir: 1) ${java.io.tmpdir}/jogamp 2) $XDG_CACHE_HOME/jogamp - if !( ANDROID | MACOS | WINDOWS | OPENKODE ) 3) $HOME/.jogamp $XDG_CACHE_HOME defaults to $HOME/.cache - TempFileCache: ${TempDir}/file_cache -> ${java.io.tmpdir}/jogamp/file_cache - LauncherTempFileCache: ${TempDir}/file_cache -> ${java.io.tmpdir}/jogamp/file_cache +++ AndroidUtils*.getTempRoot(): Remove unused AccessControlContext param --- src/java/com/jogamp/common/util/cache/TempFileCache.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/java/com/jogamp/common/util/cache') diff --git a/src/java/com/jogamp/common/util/cache/TempFileCache.java b/src/java/com/jogamp/common/util/cache/TempFileCache.java index 51c698e..cbc8ca5 100644 --- a/src/java/com/jogamp/common/util/cache/TempFileCache.java +++ b/src/java/com/jogamp/common/util/cache/TempFileCache.java @@ -46,7 +46,7 @@ public class TempFileCache { // Flag indicating that we got a fatal error in the static initializer. private static boolean staticInitError = false; - private static final String tmpDirPrefix = "jogamp.tmp.cache"; + private static final String tmpDirPrefix = "file_cache"; // Lifecycle: For one user's JVMs, ClassLoader and time. private static final File tmpBaseDir; @@ -81,7 +81,8 @@ public class TempFileCache { // exception, set an error code. File _tmpBaseDir = null; try { - _tmpBaseDir = IOUtil.getTempDir(tmpDirPrefix, acc); // Retrieve the tmpbase directory. + _tmpBaseDir = new File(IOUtil.getTempDir(true /* executable */, acc), tmpDirPrefix); + _tmpBaseDir = IOUtil.testDir(_tmpBaseDir, true /* create */, false /* executable */, acc); // executable already checked } catch (Exception ex) { System.err.println("Warning: Catched Exception while retrieving temp base directory:"); ex.printStackTrace(); -- cgit v1.2.3