[
https://issues.apache.org/jira/browse/PDFBOX-5814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tilman Hausherr updated PDFBOX-5814:
------------------------------------
Fix Version/s: 4.0.0
(was: 2.0.32)
> 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: 4.0.0, 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: [email protected]
For additional commands, e-mail: [email protected]