title: Unable to check if file exists or not in web project
body: <p>I have a pdf file in my web project at the below location :</p>
  
  <p>"static/Downloadables/20/Home_insurance_booklet.pdf "</p>
  
  <p>"static" is present in the WebContent. The context root of the project is "pas".</p>
  
  <p>In one of the jsp, I need to check if the file Home_insurance_booklet.pdf exists or not.  I tried in many ways but unable to succeed. Below is the code I have used.</p>
  
  <pre><code>String filePath = request.getContextPath()+"/static/Downloadables/20/Home_insurance_booklet.pdf";
  if(new File(filePath.toString()).exists()) {
  ------
  }
  </code></pre>
  
  <p>Through the file exists, the condition is returning false. How to check if the file exists or not w.r.t to certain location in the root of the web project ?</p>
  
  <p>Edit:
  File path displayed is
  /pas/static/Downloadables/20/Home_insurance_booklet.pdf</p>