[
https://issues.apache.org/jira/browse/RAT-593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18145216#comment-18145216
]
Philipp Ottlinger commented on RAT-593:
---------------------------------------
[~claude] is there anything more to do here than the change that got in via
RAT-592 via
[https://github.com/apache/creadur-rat/pull/774/commits/66807e080c9bca3a4d6494d294e6eba837bc4c29]
?
> short circuit TikiaProcessor DocumentType detection.
> ----------------------------------------------------
>
> Key: RAT-593
> URL: https://issues.apache.org/jira/browse/RAT-593
> Project: Apache RAT
> Issue Type: Improvement
> Components: core engine
> Affects Versions: 0.19
> Reporter: Claude Warren
> Priority: Minor
>
> After looking at the reorganization of the Document types. I think we can do
> better. In addition to the changes here we can add checks in
> {{{}TikaProcessor.fromMediaType(){}}}. Currently there is a test for the
> media type being {{Text}} but I think we can add some checks for the media
> subtype. from the list presented here it looks like if the subtype ends with
> * {{+xml}} it is a standard document
> * {{{}-zip{}}}, {{{}-bzip2{}}}, {{{}-gzip{}}}, {{-compressed}} (and perhaps
> a few others) it is an archive
> * {{+zip}} is also an archive.
> this change will require that we modifiy the TikaProcessorTest to detect that
> these extensions are not in the map.
> I think the way to do this is to modify the {{fromMediaType()}} method to
> return an Optional<Document.Type> and then modify the call in
> {{TikaProcessor.process}} to return the optional value or BINARY if there is
> no value. (exactly what we do now). The test can then verify that a proper
> value is returned and if non can still list that they are missing from the
> test/map.
>
> The advantage is that we pick up any subtypes that list themselves as XML,
> zip, bzip2, gzip, or compressed without having to add them to the map. This
> reduces the size of the map and reduces our maintenance load.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)