change cache location

This commit is contained in:
sirjonasxx 2018-10-06 23:03:24 +02:00
parent 7037d470aa
commit 0e3630e13b
2 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,6 @@
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="jna-4.5.1" level="project" /> <orderEntry type="library" name="json-simple-1.1.1" level="project" />
<orderEntry type="library" name="jna-platform-4.5.1" level="project" />
</component> </component>
</module> </module>

View File

@ -1,5 +1,6 @@
package main.misc; package main.misc;
import main.Main;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser; import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException; import org.json.simple.parser.ParseException;
@ -17,10 +18,10 @@ import java.util.Map;
*/ */
public class Cacher { public class Cacher {
private static final String CACHEFILENAME = "jsoncache.json"; private static final String CACHEFILENAME = "cache.json";
private static String getCacheDir() { private static String getCacheDir() {
return System.getProperty("user.home") + File.separator + ".G-Earth" + File.separator; return new File(Main.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParent();
} }
private static boolean cacheFileExists() { private static boolean cacheFileExists() {