How to read a partitioned configuration file using Java

Given the file containing this:

[upper]
a = A
b = B

[words]
1 = one
2 = two

How do I access these keys / values ​​with reference to their headers? The Java Properties () class processes files without partitions.

+3
source share
2 answers

Use the ini4j library (associated with the tutorial): http://ini4j.sourceforge.net/tutorial/

+6
source

If you're a fan of the Apache Commons offerings, they only have a library for you: Commons Configuration . Commons Configuration reads many more formats than .INI style files.

+3
source

Source: https://habr.com/ru/post/1765145/


All Articles