Author: tilman
Date: Mon May  6 12:22:27 2024
New Revision: 1917533

URL: http://svn.apache.org/viewvc?rev=1917533&view=rev
Log:
PDFBOX-5814: warning only for non empty files, as suggested by Anthony 
Brunellière

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

Modified: 
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: 
http://svn.apache.org/viewvc/pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1917533&r1=1917532&r2=1917533&view=diff
==============================================================================
--- 
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
 (original)
+++ 
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
 Mon May  6 12:22:27 2024
@@ -978,7 +978,7 @@ public class PDDocument implements Close
      */
     public void save(File file, CompressParameters compressParameters) throws 
IOException
     {
-        if (file.exists())
+        if (file.exists() && file.length() > 0)
         {
             LOG.warn(
                     "You are overwriting the existing file " + file.getName()


Reply via email to