The data looks like a tree (e.g. the AjaxTreeModel in the Ajax framework). Each node of the tree has a title (like a folder name for example). Each folder contains files, and can contain a sub-folder as well.
I rewrote the code to avoid dictionaries as Hugi suggested. Like this I can access the folders and the files in the folder:
String content = new String(Files.readAllBytes(Paths.get(inputFile)));
Node rootNode;
rootNode = objectMapper.readValue(content, Node.class); // Jackson
List<Node> children = rootNode.getChildren().get(2).getChildren();
children.forEach(e -> log.info(e.getTitle()));
Now the problem:
Depending on how many subfolders there are I should use either children1 or children2:
List<Node> children1 = rootNode.getChildren().get(2).getChildren().get(0).getChildren();
List<Node> children2 = rootNode.getChildren().get(2).getChildren();
Is there a way to get all the files (children.getTitle) in all the subfolders?