()
| 80 | private boolean verbose = false; |
| 81 | |
| 82 | public static AdaptConfig get() { |
| 83 | if (config == null) { |
| 84 | AdaptConfig dummy = new AdaptConfig(); |
| 85 | File l = Adapt.instance.getDataFile("adapt", "adapt.json"); |
| 86 | |
| 87 | |
| 88 | if (!l.exists()) { |
| 89 | try { |
| 90 | IO.writeAll(l, new JSONObject(new Gson().toJson(dummy)).toString(4)); |
| 91 | } catch (IOException e) { |
| 92 | e.printStackTrace(); |
| 93 | config = dummy; |
| 94 | return dummy; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | try { |
| 99 | config = new Gson().fromJson(IO.readAll(l), AdaptConfig.class); |
| 100 | IO.writeAll(l, new JSONObject(new Gson().toJson(config)).toString(4)); |
| 101 | } catch (IOException e) { |
| 102 | e.printStackTrace(); |
| 103 | config = new AdaptConfig(); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | return config; |
| 108 | } |
| 109 | |
| 110 | @Getter |
| 111 | public static class Protector { |
no test coverage detected