pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1702103 - in /pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools: Decrypt.java Encrypt.java ExportXFDF.java OverlayPDF.java
Date Wed, 09 Sep 2015 20:24:42 GMT
Author: tilman
Date: Wed Sep  9 20:24:41 2015
New Revision: 1702103

URL: http://svn.apache.org/r1702103
Log:
PDFBOX-2852: don't throw Exception, throw specific Exception instead

Modified:
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Encrypt.java
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ExportXFDF.java
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.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=1702103&r1=1702102&r2=1702103&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 Wed Sep  9 20:24:41
2015
@@ -51,9 +51,9 @@ public final class Decrypt
      *
      * @param args The command-line arguments.
      *
-     * @throws Exception If there is an error decrypting the document.
+     * @throws IOException If there is an error decrypting the document.
      */
-    public static void main( String[] args ) throws Exception
+    public static void main(String[] args) throws IOException
     {
         // suppress the Dock icon on OS X
         System.setProperty("apple.awt.UIElement", "true");
@@ -128,7 +128,7 @@ public final class Decrypt
         }
     }
 
-    private void decrypt() throws Exception
+    private void decrypt() throws IOException
     {
         PDDocument document = null;
         try

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Encrypt.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Encrypt.java?rev=1702103&r1=1702102&r2=1702103&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Encrypt.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Encrypt.java Wed Sep  9 20:24:41
2015
@@ -18,7 +18,9 @@ package org.apache.pdfbox.tools;
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
+import java.security.cert.CertificateException;
 import java.security.cert.CertificateFactory;
 import java.security.cert.X509Certificate;
 
@@ -45,9 +47,10 @@ public final class Encrypt
      *
      * @param args The command-line arguments.
      *
-     * @throws Exception If there is an error decrypting the document.
+     * @throws IOException If there is an error decrypting the document.
+     * @throws CertificateException If there is an error with a certificate.
      */
-    public static void main( String[] args ) throws Exception
+    public static void main( String[] args ) throws IOException, CertificateException
     {
         // suppress the Dock icon on OS X
         System.setProperty("apple.awt.UIElement", "true");
@@ -56,7 +59,7 @@ public final class Encrypt
         encrypt.encrypt( args );
     }
 
-    private void encrypt( String[] args ) throws Exception
+    private void encrypt( String[] args ) throws IOException, CertificateException
     {
         if( args.length < 1 )
         {

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ExportXFDF.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ExportXFDF.java?rev=1702103&r1=1702102&r2=1702103&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ExportXFDF.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ExportXFDF.java Wed Sep  9 20:24:41
2015
@@ -46,7 +46,7 @@ public class ExportXFDF
      * @param args command line arguments
      * @throws IOException in case the file can not be read or the data can not be exported.
      *
-     * @throws Exception If there is an error importing the FDF document.
+     * @throws IOException If there is an error importing the FDF document.
      */
     public static void main(String[] args) throws IOException
     {

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java?rev=1702103&r1=1702102&r2=1702103&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java Wed Sep  9 20:24:41
2015
@@ -16,6 +16,7 @@
  */
 package org.apache.pdfbox.tools;
 
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -52,9 +53,9 @@ public final class OverlayPDF
      * This will overlay a document and write out the results.
      *
      * @param args command line arguments
-     * @throws Exception if something went wrong
+     * @throws IOException if something went wrong
      */
-    public static void main(final String[] args) throws Exception 
+    public static void main(final String[] args) throws IOException
     {
         // suppress the Dock icon on OS X
         System.setProperty("apple.awt.UIElement", "true");
@@ -138,7 +139,7 @@ public final class OverlayPDF
         {
             overlayer.overlay(specificPageOverlayFile);
         } 
-        catch (Exception e) 
+        catch (IOException e) 
         {
             LOG.error("Overlay failed: " + e.getMessage(), e);
             throw e;



Mime
View raw message