Use both MimetypeFileTypeMap and FileNameMap (from URLConnection) to get
content type