pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1688495 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
Date Tue, 30 Jun 2015 18:05:55 GMT
Author: lehmi
Date: Tue Jun 30 18:05:55 2015
New Revision: 1688495

URL: http://svn.apache.org/r1688495
Log:
PDFBOX-1453: added info log if the access permission is accessed without decrypting an encrypted
pdf as proposed by Tilman Hausherr

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1688495&r1=1688494&r2=1688495&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java (original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java Tue
Jun 30 18:05:55 2015
@@ -37,6 +37,8 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSDictionary;
@@ -89,6 +91,11 @@ import org.apache.pdfbox.pdmodel.interac
 public class PDDocument implements Pageable, Closeable
 {
 
+    /**
+     * Log instance.
+     */
+    private static final Log LOG = LogFactory.getLog(PDDocument.class);
+
     private COSDocument document;
 
     //cached values
@@ -1625,6 +1632,10 @@ public class PDDocument implements Pagea
     {
         if(this.securityHandler == null)
         {
+            if (isEncrypted())
+            {
+                LOG.info("the document has not yet been decrypted, returning access permission
for a document owner");
+            }            
             return AccessPermission.getOwnerAccessPermission();
         }
         return securityHandler.getCurrentAccessPermission();



Mime
View raw message