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

Method readNode

Lib/src/main/java/me/egg82/arr/file/JSONFile.java:60–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58 }
59
60 private @Nullable JsonNode readNode() throws IOException {
61 if (!file.exists() || (file.exists() && file.isDirectory())) {
62 return null;
63 }
64
65 try (InputStream in = new BufferedInputStream(new FileInputStream(file))) {
66 tools.jackson.databind.JsonNode node = MAPPER.readTree(in);
67 return new kong.unirest.core.JsonNode(MAPPER.writeValueAsString(node));
68 }
69 }
70
71 public void write(@NotNull JsonNode data) throws IOException {
72 File parent = file.getParentFile();

Callers 1

readMethod · 0.95

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected