File tree 1 file changed +3
-0
lines changed
arduino-core/src/cc/arduino/utils/network
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -173,8 +173,10 @@ private static void updateCacheFilesInfo() throws IOException {
173
173
if (cachedFiles != null ) {
174
174
synchronized (cachedFiles ) {
175
175
ObjectMapper mapper = new ObjectMapper ();
176
+ // Generate a pretty json
176
177
mapper .enable (SerializationFeature .INDENT_OUTPUT );
177
178
final ObjectNode objectNode = mapper .createObjectNode ();
179
+ // Generate a json {"files":[...{files_info}...]}
178
180
objectNode .putArray ("files" ).addAll (
179
181
cachedFiles .values ().stream ()
180
182
.map ((v ) -> mapper .convertValue (v , JsonNode .class ))
@@ -184,6 +186,7 @@ private static void updateCacheFilesInfo() throws IOException {
184
186
if (Files .notExists (cachedFileInfo )) {
185
187
Files .createDirectories (cachedFileInfo .getParent ());
186
188
}
189
+ // Write to cache.json
187
190
mapper .writeValue (cachedFileInfo .toFile (), objectNode );
188
191
}
189
192
}
You can’t perform that action at this time.
0 commit comments