title: Alternative to javax.activation.MimetypesFileTypeMap().getContentType(filename);
body: <p>I have some code: </p>
  
  <pre><code>import javax.activation.MimetypesFileTypeMap;
  ...
  ..
  .
  String filename = "foo.xls"; // Where this can be any file name .doc, .pdf or whatever
  
  String headerContentType = new MimetypesFileTypeMap().getContentType(filename);
  </code></pre>
  
  <p>It seems javax.activation.MimetypesFileTypeMap class is inside <code>rt.jar</code> which comes with JRE System library (jdk1.6.0_10) but not in jdk1.5.0</p>
  
  <p>I would like to avoid the use of 1.6 libraries. Anyone knows an easy and quick alternative?</p>