From 0e3630e13b0bfe2994433af4fc20274ec17d84e4 Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Sat, 6 Oct 2018 23:03:24 +0200 Subject: [PATCH] change cache location --- G-Earth.iml | 3 +-- src/main/misc/Cacher.java | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/G-Earth.iml b/G-Earth.iml index 5377335..16fc742 100644 --- a/G-Earth.iml +++ b/G-Earth.iml @@ -7,7 +7,6 @@ - - + \ No newline at end of file diff --git a/src/main/misc/Cacher.java b/src/main/misc/Cacher.java index 021be4f..4581f09 100644 --- a/src/main/misc/Cacher.java +++ b/src/main/misc/Cacher.java @@ -1,5 +1,6 @@ package main.misc; +import main.Main; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; @@ -17,10 +18,10 @@ import java.util.Map; */ public class Cacher { - private static final String CACHEFILENAME = "jsoncache.json"; + private static final String CACHEFILENAME = "cache.json"; 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() {