To get the node identifiers contained in Main :
file.getConfigurationSection("Main").getKeys(false);
Conclusion:
Set["topofhouse", "2ndfloor", "home"]
The ConfigurationSection.getConfigurationSection(String path) method is used to get the path to work.
The ConfigurationSection.getKeys(boolean deep) method will provide you with all node identifiers in the current path as Set<String> . If the deep parameter is set to true , it will also receive all nodes in the child and child elements, however, all relationships between them will be lost.
source share