title: How do I prevent direct access to documents in GlassFish?
body: <p>I have a directory on my site with PDF files, each file is named using the ID of it's record (i.e. 12345.pdf, 67891.pdf).</p>
  
  <p>I want to prevent a user from access PDF files directly by simply typing in the URL of a file. I want to force the user to use a page script to access the file (e.g. /getFile?12345, where the getFile script would retrieve the file and display).</p>
  
  <p>I know using Apache you can modify the htaccess file to restrict direct access for certain file types, but I'm using GlassFish 3.1.2 and, being relatively new to it, I can't find anything about accomplishing something similar. Anybody know how to do this?</p>