[ 
https://issues.apache.org/jira/browse/TIKA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Allison resolved TIKA-2221.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 2.0

Thank you!

> poi.EncryptedDocumentException not wrapped in 
> tika.exception.EncryptedDocumentException
> ---------------------------------------------------------------------------------------
>
>                 Key: TIKA-2221
>                 URL: https://issues.apache.org/jira/browse/TIKA-2221
>             Project: Tika
>          Issue Type: Bug
>    Affects Versions: 1.14
>            Reporter: Matthew Caruana Galizia
>            Priority: Minor
>              Labels: encryption, office, poi
>             Fix For: 2.0, 1.15
>
>
> When parsing an encrypted Word document, a 
> org.apache.poi.EncryptedDocumentException is thrown at 
> WordExtractor.java#151. Tika catches this too far up the stack and 
> incorrectly wraps it in a plain TikaException instead of a 
> org.apache.tika.exception.EncryptedDocumentException.
> The fix would be to catch and wrap the exception correctly, for example:
> {noformat}
>         try {
>             document = new HWPFDocument(root);
>         } catch (org.apache.poi.EncryptedDocumentException e) {
>             throw new EncryptedDocumentException(e);
>         } catch (OldWordFileFormatException e) {
>             parseWord6(root, xhtml);
>             return;
>         }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to