GeomConverter/src/org/lcsim/util/cache
diff -u -r1.1 -r1.2
--- FileCache.java 28 Jun 2005 21:34:56 -0000 1.1
+++ FileCache.java 6 Jul 2005 04:51:19 -0000 1.2
@@ -16,11 +16,18 @@
*/
public class FileCache
{
- private static final File home = new File(System.getProperty("user.home"),".cache");
+ private static final File home = new File(getCacheRoot(),".cache");
private static final ByteFormat format = new ByteFormat();
private File cache;
private PrintStream print = System.out;
+ public static File getCacheRoot()
+ {
+ String cacheDir = System.getProperty("org.lcsim.cacheDir");
+ if (cacheDir == null) cacheDir = System.getProperty("user.home");
+ return new File(cacheDir);
+ }
+
/**
* Create a FileCache using the default cache location
* @throws java.io.IOException If the cache directory cannot be created