pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1817609 - in /pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature: CreateEmbeddedTimeStamp.java CreateSignedTimeStamp.java
Date Sat, 09 Dec 2017 13:14:37 GMT
Author: tilman
Date: Sat Dec  9 13:14:37 2017
New Revision: 1817609

URL: http://svn.apache.org/viewvc?rev=1817609&view=rev
Log:
PDFBOX-4020: close stream + delete dead code

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateEmbeddedTimeStamp.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignedTimeStamp.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateEmbeddedTimeStamp.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateEmbeddedTimeStamp.java?rev=1817609&r1=1817608&r2=1817609&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateEmbeddedTimeStamp.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateEmbeddedTimeStamp.java
Sat Dec  9 13:14:37 2017
@@ -154,7 +154,6 @@ public class CreateEmbeddedTimeStamp
             byte[] sigBlock = signature.getContents(documentBytes);
             CMSSignedData signedData = new CMSSignedData(sigBlock);
 
-            // System.out.println("INFO: Old Signature: " + Hex.getString(sigBlock));
             System.out.println("INFO: Byte Range: " + Arrays.toString(signature.getByteRange()));
 
             if (tsaUrl != null && tsaUrl.length() > 0)

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignedTimeStamp.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignedTimeStamp.java?rev=1817609&r1=1817608&r2=1817609&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignedTimeStamp.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignedTimeStamp.java
Sat Dec  9 13:14:37 2017
@@ -83,10 +83,9 @@ public class CreateSignedTimeStamp imple
             throw new FileNotFoundException("Document for signing does not exist");
         }
 
-        FileOutputStream fos = new FileOutputStream(outFile);
-
         // sign
-        try (PDDocument doc = PDDocument.load(inFile))
+        try (PDDocument doc = PDDocument.load(inFile);
+             FileOutputStream fos = new FileOutputStream(outFile))
         {
             signDetached(doc, fos);
         }



Mime
View raw message