pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1783566 - /pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java
Date Sat, 18 Feb 2017 15:29:23 GMT
Author: tilman
Date: Sat Feb 18 15:29:23 2017
New Revision: 1783566

URL: http://svn.apache.org/viewvc?rev=1783566&view=rev
Log:
PDFBOX-2852: close input stream

Modified:
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java?rev=1783566&r1=1783565&r2=1783566&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java Sat Feb 18 15:29:23
2017
@@ -21,6 +21,7 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
+import org.apache.pdfbox.io.IOUtils;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.encryption.AccessPermission;
 
@@ -131,9 +132,9 @@ public final class Decrypt
     private void decrypt() throws IOException
     {
         PDDocument document = null;
+        InputStream keyStoreStream = null;
         try
         {
-            InputStream keyStoreStream = null;
             if( keyStore != null )
             {
                 keyStoreStream = new FileInputStream(keyStore);
@@ -165,6 +166,7 @@ public final class Decrypt
             {
                 document.close();
             }
+            IOUtils.closeQuietly(keyStoreStream);
         }
     }
 



Mime
View raw message