[
https://issues.apache.org/jira/browse/NUTCH-2172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15034352#comment-15034352
]
Sebastian Nagel commented on NUTCH-2172:
----------------------------------------
This could be an improvement if we assume that MIME types do not contain white
space. In fact, there may be space between subtype and optional parameters as
in {{text/html; charset=UTF-8}} but that's a rather theoretical problem because
[tika-mimetypes.xml|https://github.com/apache/tika/blob/trunk/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml]
does not use any spaces before parameters, e.g.
{{application/x-berkeley-db;format=hash;version=2}}.
More important would be an example contenttype-mapping.txt which explains the
format, in combination with verbose warnings if the expected format isn't
matched.
> Parsing whitespace not just tabs in contenttype-mapping.txt
> -----------------------------------------------------------
>
> Key: NUTCH-2172
> URL: https://issues.apache.org/jira/browse/NUTCH-2172
> Project: Nutch
> Issue Type: Bug
> Components: metadata
> Affects Versions: 1.10
> Environment: Macosx, Java 8
> Reporter: Nicola Tonellotto
> Priority: Minor
> Labels: easyfix, newbie
> Original Estimate: 0.5h
> Remaining Estimate: 0.5h
>
> The index-more plugin uses the conf/contenttype-mapping.txt file to build up
> the mimeMap hash table (in the readConfiguration() method).
> The line splitting is performed around "\t", so it silently skip lines
> separated by simple spaces or more than one tab (see line 325).
> Changing the single-char string "\t" with the regex "\\s+" should do the
> magic.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)