There are many ways to get the Mime type from a given InputStream or File. But considering MimeType or (in terms of HTTP: content type), how do I get a list of file extensions.
The Java activation library has a MimetypesFileTypeMap, but there is an Ext → Mime Type file. I need Mime Type -> File Ext.
It seems like I would have to copy the pseudo-private code that is in com.sun.activation to load mime type mappings.
source
share