I was just wondering how most people fetch a mime type from a file in Java? So far I\'ve tried two utils: JMimeMagic
& Mime-Util
.
Th
After trying various other libraries I settled with mime-util.
eu.medsea.mimeutil
mime-util
2.1.3
File file = new File("D:/test.tif");
MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.MagicMimeMimeDetector");
Collection> mimeTypes = MimeUtil.getMimeTypes(file);
System.out.println(mimeTypes);