public class TikaMimeTypeIdentifyService extends java.lang.Object implements MimeTypeIdentifier
| Constructor and Description |
|---|
TikaMimeTypeIdentifyService() |
| Modifier and Type | Method and Description |
|---|---|
Detector |
getDetector() |
java.lang.String |
identify(byte[] data)
Identifies a MimeType based on the given data.
|
java.lang.String |
identify(byte[] data,
java.lang.String extension)
Identifies a MimeType based on the given data and file extension.
|
java.lang.String |
identify(java.io.InputStream dataStream)
Identifies a MimeType based on the given data stream.
|
java.lang.String |
identify(java.io.InputStream dataStream,
java.lang.String extension)
Identifies a MimeType based on the given data stream and file extension.
|
java.lang.String |
identify(java.lang.String extension)
Identifies a MimeType based on the file extension.
|
void |
setDetector(Detector detector)
Method for DS to set the service reference to the Detector service.
|
void |
unsetDetector(Detector detector)
Method for DS to unset the service reference to the Detector service.
|
public java.lang.String identify(byte[] data)
throws MimeTypeParseException
MimeTypeIdentifieridentify in interface MimeTypeIdentifierdata - a byte[] containing the dataMimeTypeParseException - if any error occurspublic java.lang.String identify(java.io.InputStream dataStream)
throws MimeTypeParseException
MimeTypeIdentifieridentify in interface MimeTypeIdentifierdataStream - an InputStream containing the dataMimeTypeParseException - if any error occurspublic java.lang.String identify(java.lang.String extension)
throws MimeTypeParseException
MimeTypeIdentifieridentify in interface MimeTypeIdentifierextension - the extension of the filenameMimeTypeParseException - if any error occurspublic java.lang.String identify(byte[] data,
java.lang.String extension)
throws MimeTypeParseException
MimeTypeIdentifieridentify in interface MimeTypeIdentifierdata - a byte[] containing the dataextension - the extension of the filenameMimeTypeParseException - if any error occurspublic java.lang.String identify(java.io.InputStream dataStream,
java.lang.String extension)
throws MimeTypeParseException
MimeTypeIdentifieridentify in interface MimeTypeIdentifierdataStream - an InputStream containing the dataextension - the extension of the filenameMimeTypeParseException - if any error occurspublic Detector getDetector()
public void setDetector(Detector detector)
detector - the Detector to setpublic void unsetDetector(Detector detector)
detector - the Detector to unset