Here you can find the source of getMimetype(String filename)
public static String getMimetype(String filename)
//package com.java2s; //License from project: Open Source License import javax.activation.MimetypesFileTypeMap; public class Main { private static final MimetypesFileTypeMap mimeMap = new MimetypesFileTypeMap(); public static String getMimetype(String filename) { return mimeMap.getContentType(filename); }/*w ww. j a v a 2 s.c o m*/ }