Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C2668200BA0 for ; Fri, 14 Oct 2016 20:22:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C1004160ADD; Fri, 14 Oct 2016 18:22:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 12E6A160AD3 for ; Fri, 14 Oct 2016 20:22:13 +0200 (CEST) Received: (qmail 78110 invoked by uid 500); 14 Oct 2016 18:22:13 -0000 Mailing-List: contact commits-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list commits@pdfbox.apache.org Received: (qmail 78101 invoked by uid 99); 14 Oct 2016 18:22:13 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2016 18:22:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6A79F1A04C1 for ; Fri, 14 Oct 2016 18:22:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id eEmRGehPX5KL for ; Fri, 14 Oct 2016 18:22:11 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 50FDD5F570 for ; Fri, 14 Oct 2016 18:22:11 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 871F4E06AA for ; Fri, 14 Oct 2016 18:22:07 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 8565C3A039C for ; Fri, 14 Oct 2016 18:22:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1764949 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java Date: Fri, 14 Oct 2016 18:22:07 -0000 To: commits@pdfbox.apache.org From: tilman@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161014182207.8565C3A039C@svn01-us-west.apache.org> archived-at: Fri, 14 Oct 2016 18:22:14 -0000 Author: tilman Date: Fri Oct 14 18:22:07 2016 New Revision: 1764949 URL: http://svn.apache.org/viewvc?rev=1764949&view=rev Log: PDFBOX-2852: improve javadoc Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java?rev=1764949&r1=1764948&r2=1764949&view=diff ============================================================================== --- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java (original) +++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java Fri Oct 14 18:22:07 2016 @@ -34,6 +34,7 @@ import org.apache.pdfbox.io.ScratchFile; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.encryption.AccessPermission; import org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial; +import org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException; import org.apache.pdfbox.pdmodel.encryption.PDEncryption; import org.apache.pdfbox.pdmodel.encryption.PublicKeyDecryptionMaterial; import org.apache.pdfbox.pdmodel.encryption.StandardDecryptionMaterial; @@ -180,9 +181,10 @@ public class PDFParser extends COSParser * to all the pdf's objects. It can handle linearized pdfs, which will have an xref at the end pointing to an xref * at the beginning of the file. Last the root object is parsed. * + * @throws InvalidPasswordException If the password is incorrect. * @throws IOException If something went wrong. */ - protected void initialParse() throws IOException + protected void initialParse() throws InvalidPasswordException, IOException { COSDictionary trailer = null; // parse startxref @@ -229,10 +231,11 @@ public class PDFParser extends COSParser * This will parse the stream and populate the COSDocument object. This will close * the keystore stream when it is done parsing. * + * @throws InvalidPasswordException If the password is incorrect. * @throws IOException If there is an error reading from the stream or corrupt data * is found. */ - public void parse() throws IOException + public void parse() throws InvalidPasswordException, IOException { // set to false if all is processed boolean exceptionOccurred = true; @@ -265,9 +268,10 @@ public class PDFParser extends COSParser /** * Prepare for decryption. * + * @throws InvalidPasswordException If the password is incorrect. * @throws IOException if something went wrong */ - private void prepareDecryption() throws IOException + private void prepareDecryption() throws InvalidPasswordException, IOException { COSBase trailerEncryptItem = document.getTrailer().getItem(COSName.ENCRYPT); if (trailerEncryptItem != null && !(trailerEncryptItem instanceof COSNull))