This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Steps to reproduce: - open file - do print (Ctrl-P) - select "to file" wit file name: ~/out.ps IDE Throw: Fri Aug 25 16:37:01 GMT+02:00 2000java.awt.print.PrinterIOException: java.io.FileNotFoundException: ~/out.ps (No such file or directory) java.awt.print.PrinterIOException: java.io.FileNotFoundException: ~/out.ps (No such file or directory) at sun.awt.motif.PSPrinterJob$PrinterOpener.run(PSPrinterJob.java:649) at java.security.AccessController.doPrivileged(Native Method) at sun.awt.motif.PSPrinterJob.startDoc(PSPrinterJob.java:558) at sun.java2d.RasterPrinterJob.print(RasterPrinterJob.java:315) at org.openide.text.CloneableEditorSupport.print(CloneableEditorSupport.java:461) at org.openide.actions.PrintAction$1.run(PrintAction.java:43)
I think that expansion of ~ is done by shell so you need to use the full path in this case. Can you please test it?
With full path it's OK. I accept that expand ~ can be problem but why Exception?
I think it should show dialog, that the specified path to file is unknown or illegal. '~' is expanded by shell and I think that none or almost none user program expands it. Second possibility can be to create file with directories, so you will see directory '~' in your home directory.
As the exception is thrown in AWT classes the only thing that we can do is to catch the exception and display something more reasonable. Initially I thought that we could catch FileNotFoundException generally in PrintAction and display some hint that the user should check the file path but later I've realized that the PrintCookie.print() doesn't throw IOException so we would have to manage it in every print cookie that we write e.g. in CloneableEditorSupport. Alesi, what do you think about it?
Fixed in main trunk. I have inserted a hint into CloneableEditorSupport.
Resolved for 3.3.x or earlier, no new info since then -> closing.
A mistakenly closed RESOLVED LATER/REMIND issue. Reopening.
The issue has been already fixed.
Verified in build 200412221900.