Best practice - Directory location in the project to place xml file (non framework XML)
posted 2 years ago
I have to parse an XML file that contains some metadata information. Later the parsed information is used in my java classes. XML file could contain static contents like supported file types etc.
What is the correct directory location for such file? Can I keep it along with the java class file?
Well don't know what's the "best practice" for this kind of stuff is. But for me if the XML file has content that "can be changed/updated over time" then put the file outside of the project or app.
Using web app as example even you probably using ejb, I put the xml files in a "xml" folder in the root directory of my web domain. Then in my java web app I retrieve them as "http://hostname/xml/blablabla.xml".