I have a 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 that the javax.activation.MimetypesFileTypeMap class is inside rt.jarthat comes with the JRE System library (jdk1.6.0_10), but not in jdk1.5.0
I would like to avoid using 1.6 libraries. Does anyone know an easy and quick alternative?
source
share