mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
6218397: Printing to file does not throw a PrinterException if the file cannot be created
Reviewed-by: prr, jdv
This commit is contained in:
parent
41e155e1e1
commit
fa55ad2d91
2 changed files with 9 additions and 1 deletions
|
@ -1627,6 +1627,9 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
(!f.isFile() || !f.canWrite())) ||
|
||||
((pFile != null) &&
|
||||
(!pFile.exists() || (pFile.exists() && !pFile.canWrite())))) {
|
||||
if (f.exists()) {
|
||||
f.delete();
|
||||
}
|
||||
throw new PrinterException("Cannot write to file:"+
|
||||
dest);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue