title: HttpServletRequest: How to determine Content-Type of requested asset
body: <p>I am writing a quick-and-dirty static file server using Jetty. I need to set the Content-Type for each response:</p>
  
  <pre><code>HttpServletResponse.setContentType("content/type");
  </code></pre>
  
  <p>For a given file request, how do I reliably determine what content type to set? Is it a question of examining the file extension, or is there a more sophisticated method? (E.g what if there is no file extension, or the extension does not reflect the content type?)</p>
  
  <p>Thanks Richard</p>