diff --git a/cache/pom.xml b/cache/pom.xml index 11d7a448bd..8d3a1d2660 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -124,6 +124,9 @@ true -Xmx2048m + + ${cache.tmpdir} + diff --git a/cache/src/test/java/net/runelite/cache/StoreLocation.java b/cache/src/test/java/net/runelite/cache/StoreLocation.java index c751a3f19c..890e43e5eb 100644 --- a/cache/src/test/java/net/runelite/cache/StoreLocation.java +++ b/cache/src/test/java/net/runelite/cache/StoreLocation.java @@ -24,11 +24,11 @@ */ package net.runelite.cache; +import com.google.common.base.Strings; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; -import java.util.Properties; import org.junit.rules.TemporaryFolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,18 +38,17 @@ public class StoreLocation private static final Logger logger = LoggerFactory.getLogger(StoreLocation.class); private static final int NUM_INDEXES = 16; - private static final String TMP_DIR = "d:/temp"; public static File LOCATION; private static File TMP; static { - File tmp = new File(TMP_DIR); - if (tmp.exists() || tmp.mkdir()) + String cacheTmpDir = System.getProperty("cache.tmpdir"); + if (!Strings.isNullOrEmpty(cacheTmpDir)) { - System.setProperty("java.io.tmpdir", TMP_DIR); - TMP = tmp; + System.setProperty("java.io.tmpdir", cacheTmpDir); + TMP = new File(cacheTmpDir); } try @@ -99,7 +98,7 @@ public class StoreLocation @Override public void after() { - // don't cleanup if using local tmpdir + // don't cleanup if using cache tmpdir if (TMP == null) { super.after();