[
https://issues.apache.org/jira/browse/RAT-593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18145146#comment-18145146
]
ASF subversion and git services commented on RAT-593:
-----------------------------------------------------
Commit 66807e080c9bca3a4d6494d294e6eba837bc4c29 in creadur-rat's branch
refs/heads/fix/RAT-592 from Philipp Ottlinger
[ https://gitbox.apache.org/repos/asf?p=creadur-rat.git;h=66807e080 ]
RAT-592, RAT-593: Apply review comments
> 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)