The project I inherited has an excel template that gets populated when the user performs an action. Whoever programmed it originally did this in the ApplicationProperties.properties file.
#LOCAL
TemplatePath=C:/.../web/fileName.xls
#LIVE
#TemplatePath=/usr/share/tomcat/webapps/projectName/fileName.xls
There are a few different files that are set up like this so every time we have to deploy I have to make sure to go into the application properties file and update them. I would like to refactor the code so that can be done with only a relative path to the file. If this were a .net project I would use Server.MapPath() to get the current path and then append the directory/file name onto it.
Is there a way to do that in Java? Or is there a better way? I noticed something about putting the file in WEBINF/classes when I was googling the issue. Is that better? How does that work? I'm new to Java.