title: Relative file reference in Java
body: <p>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.</p>
  
  <pre><code>#LOCAL
  TemplatePath=C:/.../web/fileName.xls
  #LIVE
  #TemplatePath=/usr/share/tomcat/webapps/projectName/fileName.xls
  </code></pre>
  
  <p>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.</p>
  
  <p>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.</p>