title: Does endsWith consider a path's file extension, and is this a security vulnerability?
body: <p>When I call <code>endsWith(".pdf")</code>, would this open malware.pdf.exe or just malware.pdf?</p>
  
  <pre><code>String sFileName = request.getParameter("fName");
  if (sFileName.toLowerCase().endsWith(".pdf"))
  // open file
  else
  // don’t open the file
  </code></pre>