title: How to get a file's Media Type (MIME type)?
body: <p>How do you get a Media Type (MIME type) from a file using Java?  So far I've tried JMimeMagic &amp; Mime-Util. The first gave me memory exceptions, the second doesn't close its streams properly.</p>
  <p>How would you probe the file to determine its actual type (not merely based on the extension)?</p>