@Immutable @ThreadSafe public abstract class TikaMimeTypeDetector extends Object implements MimeTypeDetector
MimeTypeDetector
s that use the Tika library.Modifier | Constructor and Description |
---|---|
protected |
TikaMimeTypeDetector(Environment environment) |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
detect(InputStream inputStream,
org.apache.tika.metadata.Metadata metadata) |
protected abstract void |
initDetector(ClassLoader loader) |
String |
mimeTypeOf(String name,
Binary binaryValue)
Returns the MIME-type of a binary value, using its supplied content and/or its supplied name, depending upon the
implementation.
|
protected final Logger logger
protected TikaMimeTypeDetector(Environment environment)
public String mimeTypeOf(String name, Binary binaryValue) throws RepositoryException, IOException
MimeTypeDetector
null
may be returned,
where the former will prevent earlier registered MIME-type detectors from being consulted.mimeTypeOf
in interface MimeTypeDetector
name
- The name of the data source; may be null
.binaryValue
- The value which contains the raw data for which the mime type should be returned; may be
null
.null
if the MIME-type could not be determined.RepositoryException
- if any error occurs while attempting to read the stream from the binary valueIOException
- If an error occurs reading the supplied content.protected abstract void initDetector(ClassLoader loader)
protected abstract String detect(InputStream inputStream, org.apache.tika.metadata.Metadata metadata)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.