pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1637565 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDocument.java
Date Sat, 08 Nov 2014 13:52:12 GMT
Author: lehmi
Date: Sat Nov  8 13:52:11 2014
New Revision: 1637565

URL: http://svn.apache.org/r1637565
Log:
PDFBOX-2490: clarify the meaning of the return value of isEncrypted, added isDecrypted

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDocument.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDocument.java?rev=1637565&r1=1637564&r2=1637565&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDocument.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDocument.java Sat Nov  8 13:52:11
2014
@@ -305,12 +305,24 @@ public class COSDocument extends COSBase
     /** 
      * Signals that the document is decrypted completely.
      * Needed e.g. by {@link org.apache.pdfbox.pdfparser.NonSequentialPDFParser} to circumvent
-     * additional decryption later on. */
+     * additional decryption later on. 
+     */
     public void setDecrypted()
     {
         isDecrypted = true;
     }
 
+    /** 
+     * Indicates if a encrypted pdf is already decrypted after parsing.
+     * Does make sense only if the {@link org.apache.pdfbox.pdfparser.NonSequentialPDFParser}
is used.
+     * 
+     *  @return true indicates that the pdf is decrypted.
+     */
+    public boolean isDecrypted()
+    {
+        return isDecrypted;
+    }
+    
     /**
      * This will tell if this is an encrypted document.
      *
@@ -318,10 +330,6 @@ public class COSDocument extends COSBase
      */
     public boolean isEncrypted()
     {
-        if ( isDecrypted )
-        {
-            return false;
-        }
         boolean encrypted = false;
         if( trailer != null )
         {



Mime
View raw message