Class WindowsRegistryMimeDetector

java.lang.Object
eu.medsea.mimeutil.detector.MimeDetector
eu.medsea.mimeutil.detector.WindowsRegistryMimeDetector

public class WindowsRegistryMimeDetector extends MimeDetector
Get the content type for a file extension as stored in the Windows Registry The extensions are stored at "HKEY_CLASSES_ROOT"

This MimeDetector will only operate on Windows machines. On any other platform the methods throw a UnsupportedOperationException (These are swallowed by the MimeUtil class) Therefore, it is perfectly acceptable to register this MimeDetector with MimeUtil and it will only be used on a Windows Platform. On all other platforms it will just be ignored.

To register this MimeDetector use
MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.WindowsRegistryMimeDetector");

The Collection returned from the getMimeTypesXXX(...) Methods with contain either a single MimeType or the collection will be empty.

This MimeDetector only performs file extension mapping, so the methods taking an InputStream and byte array throw UnsupportedOperationException