Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read the property file when duplicate key-value pair exist in the file?

I am loading my property file using the load() of properties class.I am able to read the key-value pair of the property class using set,hashmap,treeset,enumeration, but it does not retrieve the duplicate pairs. The duplicate pairs are retrieved only once.

like image 359
user3089783 Avatar asked Dec 11 '13 06:12

user3089783


Video Answer


1 Answers

PropertiesConfiguration from Apache Commons Configuration supports loading a properties file with multiple entries with the same key.

Use the getStringArray(key) method or getList(key) method to access all values for the specified key.

like image 75
Mark Avatar answered Sep 22 '22 00:09

Mark