|
From: <ka...@us...> - 2010-10-07 20:33:07
|
Revision: 3432
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3432&view=rev
Author: kappa1
Date: 2010-10-07 20:33:01 +0000 (Thu, 07 Oct 2010)
Log Message:
-----------
AppletLoader: move cache directory to a better location, as the current location is periodically purged on mac and linux.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-10-04 22:51:19 UTC (rev 3431)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2010-10-07 20:33:01 UTC (rev 3432)
@@ -259,7 +259,7 @@
*/
public void init() {
state = STATE_INIT;
-
+
// sanity check
String[] requiredArgs = {"al_main", "al_logo", "al_progressbar", "al_jars"};
for ( String requiredArg : requiredArgs ) {
@@ -693,7 +693,7 @@
}
codebase += File.separator;
}
- return System.getProperty("java.io.tmpdir") + File.separator + codebase + getParameter("al_title") + File.separator;
+ return getCacheDir() + File.separator + codebase + getParameter("al_title") + File.separator;
}
});
@@ -775,6 +775,21 @@
loaderThread = null;
}
}
+
+ /**
+ * get path to the lwjgl cache directory
+ *
+ * @return path to the lwjgl cache directory
+ */
+ protected String getCacheDir() {
+ String cacheDir = System.getProperty("deployment.user.cachedir");
+
+ if (cacheDir == null) {
+ cacheDir = System.getProperty("java.io.tmpdir");
+ }
+
+ return cacheDir + File.separator + "lwjglcache";
+ }
/**
* read the current version file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|