[
https://issues.apache.org/jira/browse/SLING-1059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760197#action_12760197
]
Jukka Zitting commented on SLING-1059:
--------------------------------------
Starting with the 0.4 version Tika has become more modularized, so you can get
the type detection functionality and all the related default configuration from
the reasonably sized tika-core component that has no external dependencies.
The latest Tika trunk also contains all the type information (both mime.types
and magic) from the Apache HTTP Server.
I looked at the MimeTypeProvider interface in Sling. The getMimeType(String)
method could be implemented with the latest Tika 0.5-SNAPSHOT like this:
public String getMimeType(String name) {
return new Tika().detect(name);
}
The same functionality is available also in Tika 0.4, but with ten lines of
code instead of one.
For deeper integration, see the Detector interface [1] that could be used as a
MimeTypeProvider replacement to add features like content-based type detection.
Note that Tika does not come with a MimeTypeProvider.getExtension(String)
feature, but I couldn't find any place in Sling (apart from test cases) where
that functionality is actually being used.
[1]
https://svn.apache.org/repos/asf/lucene/tika/trunk/tika-core/src/main/java/org/apache/tika/detect/Detector.java
> Mime Type Detection for WebDAV should use Apache Tika
> -----------------------------------------------------
>
> Key: SLING-1059
> URL: https://issues.apache.org/jira/browse/SLING-1059
> Project: Sling
> Issue Type: Improvement
> Reporter: Lars Trieloff
> Priority: Minor
>
> Sling's WebDAV servlet currently has its own Mime Type detection mechanism.
> Given that Tika is a dependency of the soon to be added Jackrabbit 2.0 we can
> re-use Tika's Mime Type detection mechanism for greater accuracy and a better
> maintained list of mimetype-extension-mappings.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.