I have some 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);
It seems javax.activation.MimetypesFileTypeMap class is inside rt.jar
which comes with JRE System library (jdk1.6.0_10) but not in jdk1.5.0
I would like to avoid the use of 1.6 libraries. Anyone knows an easy and quick alternative?