()
| 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(); |