@Immutable @ThreadSafe public final class ContentDetector extends TikaMimeTypeDetector
MimeTypeDetector
implementation which uses Apache Tika to determine the mimetype of a given binary, based on the
content (binary) header. This involves reading at least the first X bytes from each binary and is more expensive than
NameOnlyDetector
logger
Constructor and Description |
---|
ContentDetector(Environment environment)
Creates a new content detector
|
Modifier and Type | Method and Description |
---|---|
protected String |
detect(InputStream inputStream,
org.apache.tika.metadata.Metadata metadata) |
protected void |
initDetector(ClassLoader loader) |
mimeTypeOf
public ContentDetector(Environment environment)
environment
- the Environment
to use for class loading; may not be null
protected void initDetector(ClassLoader loader)
initDetector
in class TikaMimeTypeDetector
protected String detect(InputStream inputStream, org.apache.tika.metadata.Metadata metadata)
detect
in class TikaMimeTypeDetector
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.