[ https://issues.apache.org/jira/browse/PDFBOX-5814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17843728#comment-17843728 ]
ASF subversion and git services commented on PDFBOX-5814: --------------------------------------------------------- Commit 1917534 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1917534 ] PDFBOX-5814: warning only for non empty files, as suggested by Anthony Brunellière > 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: 2.0.31, 3.0.2 PDFBox > Reporter: Tilman Hausherr > Assignee: Tilman Hausherr > Priority: Minor > 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