Claudenw commented on code in PR #774:
URL: https://github.com/apache/creadur-rat/pull/774#discussion_r4578209661


##########
apache-rat-core/src/main/java/org/apache/rat/analysis/TikaProcessor.java:
##########


Review Comment:
   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.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to