I know single file caching, given the absolute file path with the full property file location. Now there will be multiple files get added run time in a folder location,from there I need to see whenever a new property file is added or an existing property file get updated, server cache needs to be loaded with the updated or newly added files. As of now not having any idea on how can this be done.
You can watch folders using the api described here:http://docs.oracle.com/javase/tutorial/essential/io/notification.html
For caching you can implement yourself manually or use caching APIs like ehcache.
Whether you can use any of these techniques or how to use them depends on the environment your application runs in e.g application server or standalone.
Any more ideas on this please. I will be getting multiple property files at run time, and I need to maintain cache for them, as and when they are modified or newly added. Basically a multi dimensional Hasmap with multiple files storing each file key value pairs.
Use a java.util.ResourceBundle per file, always access them via the static getBundle() method (don't store references to them), and call clearCache() when any of the files change, which you can detect in several ways using java.io or NIO2.