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.

Bug 7498 - Print to file throws FileNotFoundException.
Summary: Print to file throws FileNotFoundException.
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: anovak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-08-25 15:47 UTC by Martin Schovanek
Modified: 2007-11-05 13:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Schovanek 2000-08-25 15:47:11 UTC
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)
Comment 1 Miloslav Metelka 2000-08-25 16:12:59 UTC
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?
Comment 2 Martin Schovanek 2000-08-25 17:03:59 UTC
With full path it's OK. I accept that expand ~ can be problem but why Exception?
Comment 3 Jan Lahoda 2000-09-25 13:25:59 UTC
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.
Comment 4 Miloslav Metelka 2000-09-27 15:49:59 UTC
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?
Comment 5 anovak 2000-09-28 09:05:59 UTC
Fixed in main trunk.
I have inserted a hint into CloneableEditorSupport.
Comment 6 Quality Engineering 2003-06-30 18:00:15 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 7 Quality Engineering 2003-06-30 18:09:33 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 8 Jan Chalupa 2003-10-30 12:06:21 UTC
A mistakenly closed RESOLVED LATER/REMIND issue. Reopening.
Comment 9 Martin Roskanin 2003-11-13 15:19:08 UTC
The issue has been already fixed.
Comment 10 Roman Strobl 2004-12-23 15:34:25 UTC
Verified in build 200412221900.