If it possible to detect if a .properties file is being loaded from inside a jar file.
I have a class that loads a bean from a .properties file and then sets up a listener to reload the bean if it changes. If the .properties file is in a jar then the listener is of no use and I want to try and detect this from within my code.
posted 10 years ago
NOTE, I haven't tried this myself but, you are more than likely using ClassLoader.getResourceAsStream to load that properties file. You can also use ClassLoader.findResource to get the URL and see if it is a jar url or a file url.