posted 17 years ago
I left a lot out of that suggestion.
First, read up on ClassLoaders. You can write a custom ClassLoader that extends URLClassLoader and override the method I showed before. When it succesfully loads a class, it calls a listener object with name and full classname. You might pass that listener object to your ClassLoader in the ClassLoader constructor.
Then pass your own ClassLoader to ResourceBundle.get().
Now ResourceBundle calls the ClassLoader over and over, once for each candidate name that it might load. When it actually finds a file, the loader will call your listener and you save off the information. When ResourceBundle returns you a bundle, the info you saved should be the latest file loaded.
I can't guarantee this will work out ... give it a try and see!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi