aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util/cache
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-06-16 05:31:47 +0200
committerSven Gothel <[email protected]>2012-06-16 05:31:47 +0200
commit1468286bf569a493e4fdb887d5f3732f88c8cec3 (patch)
treeafc32c3e1805405ea7faf56bcc8ae3c16d8f9fb4 /src/java/com/jogamp/common/util/cache
parenta52fe4275045252d9bd4436adec11aec393fadd5 (diff)
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
Diffstat (limited to 'src/java/com/jogamp/common/util/cache')
-rw-r--r--src/java/com/jogamp/common/util/cache/TempFileCache.java5
1 files changed, 3 insertions, 2 deletions
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();