()
| 365 | } |
| 366 | |
| 367 | private static boolean isCacheWritable() { |
| 368 | JSONFile testFile = new JSONFile(new File(CacheConfigVars.getFile(CacheConfigVars.CACHE_DIR), "touch.json")); |
| 369 | try { |
| 370 | boolean writable = BooleanParser.get(false, testFile.read().getObject(), "writable"); |
| 371 | if (!writable) { |
| 372 | testFile.write(new JsonNode(new JSONObject(Map.of("writable", true)).toString())); |
| 373 | } |
| 374 | } catch (IOException ignored) { |
| 375 | return false; |
| 376 | } |
| 377 | return true; |
| 378 | } |
| 379 | } |