MCPcopy Create free account
hub / github.com/egg82/fetcharr / isCacheWritable

Method isCacheWritable

App/src/main/java/me/egg82/fetcharr/Main.java:367–378  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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}

Callers 1

mainMethod · 0.95

Calls 5

getFileMethod · 0.95
getMethod · 0.95
readMethod · 0.95
writeMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected