title: Get Path of current file
body: <p>How do I get the directory where the a .java file is located? I don't want to use <code>System.getProperty("user.dir")</code>, because that gives me the directory of the executable, and not the directory of the .java file that contains this line of code.</p>
  
  <p>I need this because I'm developing a JSP web-app, and the Java code creates a .csv file on the server side and I want to make it available on the client side, but I would need to place the csv file where the location of the .html files are so that they could be downloaded.</p>
  
  <p>My current folder structure is like:</p>
  
  <p>Java Resources
  ->src<br>
       ->.java file </p>
  
  <p>WebContent<br>
  ->.html file</p>