Tilman Hausherr created PDFBOX-5814:
---------------------------------------

             Summary: Limit overwrite warning to non empty files
                 Key: PDFBOX-5814
                 URL: https://issues.apache.org/jira/browse/PDFBOX-5814
             Project: PDFBox
          Issue Type: Improvement
          Components: Writing
    Affects Versions: 3.0.2 PDFBox, 2.0.31
            Reporter: Tilman Hausherr
            Assignee: Tilman Hausherr
             Fix For: 2.0.32, 3.0.3 PDFBox


As written by Anthony Brunellière on the dev mailing list:
{code:java}
The method PDDocument.save(..) (version 3.0.2) generates a warning if the 
output file already exists :
{code:java}
public void save(File file, CompressParameters compressParameters) throws 
IOException
    {
        if (file.exists())
        {
            LOG.warn(
                    "You are overwriting the existing file " + file.getName()
                            + ", this will produce a corrupted file if you're 
also reading from it");
        }
{code}
I understand the disclaimer "Don't use the input file as target as this will 
produce a corrupted file", but I'm in a context where an empty ouput file is 
created just before for specific reasons.

Should this warning be limited to non-empty files?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to