[ 
https://issues.apache.org/jira/browse/TIKA-1221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13872150#comment-13872150
 ] 

Nick Burch commented on TIKA-1221:
----------------------------------

That magic string looks very brittle to me - entries in zip files can come in 
any order

Would we not be better patching the "container aware logic" in 
ZipContainerDetector to check for the xps specific entries, so we have a 
solution that'll work no matter what order the files come in the zip structure?

> XPS detection
> -------------
>
>                 Key: TIKA-1221
>                 URL: https://issues.apache.org/jira/browse/TIKA-1221
>             Project: Tika
>          Issue Type: Bug
>          Components: detector, mime
>    Affects Versions: 1.4
>            Reporter: Marco Quaranta
>
> Tika now detect xps files using only file extension.
> Please modify XPS definition in tika-mimetypes.xml in the following way:
> {noformat}
>       <mime-type type="application/vnd.ms-xpsdocument">
>               <glob pattern="*.xps"/>
>               <sub-class-of type="application/zip" />
>               <magic priority="50">
>                       <match value="PK\003\004" type="string" offset="0">
>                               <match value="Metadata/Job_PT.xml" 
> type="string" offset="30" />
>                       </match>
>               </magic>
>       </mime-type>
> {noformat}
> Thank you,
> Marco



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to