|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object eu.medsea.mimeutil.detector.MimeDetector eu.medsea.mimeutil.detector.WindowsRegistryMimeDetector
public class WindowsRegistryMimeDetector
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
Constructor Summary | |
---|---|
WindowsRegistryMimeDetector()
|
Method Summary | |
---|---|
String |
getDescription()
Abstract method to be implement by concrete MimeDetector(s). |
Collection |
getMimeTypesByteArray(byte[] data)
Content detection not supported |
Collection |
getMimeTypesFile(File file)
Abstract method that must be implemented by concrete MimeDetector(s). |
Collection |
getMimeTypesFileName(String fileName)
Abstract method that must be implemented by concrete MimeDetector(s). |
Collection |
getMimeTypesInputStream(InputStream in)
Content detection not supported |
Collection |
getMimeTypesURL(URL url)
Abstract method that must be implemented by concrete MimeDetector(s). |
Methods inherited from class eu.medsea.mimeutil.detector.MimeDetector |
---|
closeStream, delete, getMimeTypes, getMimeTypes, getMimeTypes, getMimeTypes, getMimeTypes, getName, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WindowsRegistryMimeDetector()
Method Detail |
---|
public String getDescription()
MimeDetector
getDescription
in class MimeDetector
public Collection getMimeTypesFile(File file) throws UnsupportedOperationException
MimeDetector
getMimeTypesFile
in class MimeDetector
UnsupportedOperationException
public Collection getMimeTypesFileName(String fileName) throws UnsupportedOperationException
MimeDetector
getMimeTypesFileName
in class MimeDetector
UnsupportedOperationException
public Collection getMimeTypesURL(URL url) throws UnsupportedOperationException
MimeDetector
getMimeTypesURL
in class MimeDetector
UnsupportedOperationException
public Collection getMimeTypesByteArray(byte[] data) throws UnsupportedOperationException
getMimeTypesByteArray
in class MimeDetector
data
- byte []. Is a byte array that you want to parse for matching mime types.
UnsupportedOperationException
public Collection getMimeTypesInputStream(InputStream in) throws UnsupportedOperationException
getMimeTypesInputStream
in class MimeDetector
in
- InputStream.
UnsupportedOperationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |