I want to use java.util.Properties , you can use prefixes. In the .properties file:
group1.key1=valgroup1key1 group2.key1=valgroup2key1 group2.key2=valgroup2key2
and read them as follows:
class PrefixedProperty extends Properties { public String getProperty(String group, String key) { return getProperty(group + '.' + key); } }
and using:
String val = prefixedProperty.getProperty("group1", "key1");
You can also use ini4j with windows ini files.
Another, better way is to use your own, customizable structured file (such as XML).
source share