diff options
| author | 2018-10-26 19:42:24 +0200 | |
|---|---|---|
| committer | 2018-10-26 19:42:42 +0200 | |
| commit | 97056986946cafdf79005721161edea2087c3b67 (patch) | |
| tree | 020fede2de6dcb120ebc74569b856bb9f7e2e59d /src/main/java/cuchaz/enigma/config/Config.java | |
| parent | make rebuild method names discard child-only names. imperfect, but eh (diff) | |
| parent | "make sure this is actually a field" properly (diff) | |
| download | enigma-fork-97056986946cafdf79005721161edea2087c3b67.tar.gz enigma-fork-97056986946cafdf79005721161edea2087c3b67.tar.xz enigma-fork-97056986946cafdf79005721161edea2087c3b67.zip | |
update ASM/Guava, merge ASM port fixes
Diffstat (limited to 'src/main/java/cuchaz/enigma/config/Config.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/config/Config.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/cuchaz/enigma/config/Config.java b/src/main/java/cuchaz/enigma/config/Config.java index 87ef353..75ced70 100644 --- a/src/main/java/cuchaz/enigma/config/Config.java +++ b/src/main/java/cuchaz/enigma/config/Config.java | |||
| @@ -62,7 +62,7 @@ public class Config { | |||
| 62 | public void loadConfig() throws IOException { | 62 | public void loadConfig() throws IOException { |
| 63 | if (!ENIGMA_DIR.exists()) ENIGMA_DIR.mkdirs(); | 63 | if (!ENIGMA_DIR.exists()) ENIGMA_DIR.mkdirs(); |
| 64 | File configFile = new File(ENIGMA_DIR, "config.json"); | 64 | File configFile = new File(ENIGMA_DIR, "config.json"); |
| 65 | if (configFile.exists()) gson.fromJson(Files.toString(configFile, Charset.defaultCharset()), Config.class); | 65 | if (configFile.exists()) gson.fromJson(Files.asCharSource(configFile, Charset.defaultCharset()).read(), Config.class); |
| 66 | else { | 66 | else { |
| 67 | this.reset(); | 67 | this.reset(); |
| 68 | Files.touch(configFile); | 68 | Files.touch(configFile); |
| @@ -71,7 +71,7 @@ public class Config { | |||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | public void saveConfig() throws IOException { | 73 | public void saveConfig() throws IOException { |
| 74 | Files.write(gson.toJson(this), CONFIG_FILE, Charset.defaultCharset()); | 74 | Files.asCharSink(CONFIG_FILE, Charset.defaultCharset()).write(gson.toJson(this)); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | public void reset() throws IOException { | 77 | public void reset() throws IOException { |