How do I package config data for my web application that can be updated?
I have a web service that provides clients with configuration data. It receives a request containing a version (ex: "v1") of that configuration data and needs to retrieve the data associated with that version. New versions of configura开发者_StackOverflowtion data can be added while the web service is running.
The directory structure of the configuration data is:
config
v1
...config files...
v2
...config files...
v3
...config files...
I know that web application best practices state I should not use java.io.File and should instead use ClassLoader.getResource(), so how do I go about doing that? I can't compile my config data into a JAR because it can be updated while the service is running, so do I place the data on the filesystem and add that directory to my classpath?
We didn't find any way to do this with Weblogic, so we updated the application to read the data from the filesystem instead of the classpath.
精彩评论