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.
JMimeMagic
Mime-Util
Th
File file = new File(PropertiesReader.FILE_PATH); MimetypesFileTypeMap fileTypeMap = new MimetypesFileTypeMap(); String mimeType = fileTypeMap.getContentType(file); URLConnection uconnection = file.toURL().openConnection(); mimeType = uconnection.getContentType();