You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Hewson (JIRA)" <ji...@apache.org> on 2014/03/12 03:59:48 UTC

[jira] [Comment Edited] (PDFBOX-1973) Don't wrap Exceptions with COSVisitorException

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

John Hewson edited comment on PDFBOX-1973 at 3/12/14 2:58 AM:
--------------------------------------------------------------

BadSecurityHandlerException can also be removed, it is used to indicate that a custom SecurityHandler needed for reading a given file is missing, but there is nothing specific that can be done by a user who catches this exception, so I replaced it with an IOException instead.

For reading encrypted files, I've done some minor refactoring to the SecurityHandler classes so that there is never any need to throw any exception, as we already know that the chosen SecurityHandler is available. This mostly effects the behaviour of SecurityHandlersManager which can now be found in SecurityHandlerFactory.

Revision 1576570 makes these changes.


was (Author: jahewson):
BadSecurityHandlerException can also be removed, it is used to indicate that the javax.crypto provider needed for reading a given file is missing, but there is nothing specific that can be done by a user who catches this exception, so I replaced it with an IOException instead.

For reading encrypted files, I've done some minor refactoring to the SecurityHandler classes so that there is never any need to throw any exception, as we already know that the chosen javax.crypto provider is available. This mostly effects the behaviour of SecurityHandlersManager which can now be found in SecurityHandlerFactory.

Revision 1576570 makes these changes.

> Don't wrap Exceptions with COSVisitorException
> ----------------------------------------------
>
>                 Key: PDFBOX-1973
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1973
>             Project: PDFBox
>          Issue Type: Improvement
>            Reporter: John Hewson
>            Assignee: John Hewson
>            Priority: Minor
>
> COSVisitorException is redundant, it is a simple wrapper for SignatureException, CryptographyException and NoSuchAlgorithmException and should be replaced by those exceptions directly.
> For example, we can replace:
> public void write(PDDocument doc) throws COSVisitorException
> With:
> public void write(PDDocument doc) throws IOException, CryptographyException
> and so on...



--
This message was sent by Atlassian JIRA
(v6.2#6252)