make sure hashSupport can access cached hashfile

This commit is contained in:
sirjonasxx 2018-11-17 19:31:52 +01:00
parent 85b2fcd5c0
commit 30def90d77
2 changed files with 12 additions and 5 deletions

View File

@ -19,13 +19,20 @@ public class Cacher {
private static final String DEFAULT_CACHE_FILENAME = "cache.json"; private static final String DEFAULT_CACHE_FILENAME = "cache.json";
private static String getCacheDir() { private static String getCacheDir() {
File GEarthDir = null;
try { try {
return new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParent() GEarthDir = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile();
+ File.separator if (GEarthDir.getName().equals("Extensions")) {
+ "Cache"; GEarthDir = GEarthDir.getParentFile();
}
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
return null; // e.printStackTrace();
} }
return GEarthDir
+ File.separator
+ "Cache";
} }

View File

@ -24,7 +24,7 @@
<!-- Compile our extensions too please! --> <!-- Compile our extensions too please! -->
<module>Extensions/AdminOnConnect</module> <module>Extensions/AdminOnConnect</module>
<module>Extensions/BlockReplacePackets</module> <module>Extensions/BlockReplacePackets</module>
<module>Extensions/SpeechColorizer</module> <module>Extensions/HappySpeech</module>
</modules> </modules>
<build> <build>