permaculture playing cards*
The moose likes I/O and Streams and the fly likes FileNotFoundException and NoSuchFileException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "FileNotFoundException and NoSuchFileException" Watch "FileNotFoundException and NoSuchFileException" New topic

FileNotFoundException and NoSuchFileException

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305 xanadu.txt (The system cannot find the file specified)
According to this thread my program should throw NoSuchFileException because that file does not exist.

My one regret in life is that I am not someone else.
- Woody Allen
Tony Docherty

Joined: Aug 07, 2007
Posts: 2170
Always read the API docs.

NoSuchFileException is thrown by classes in the java.nio package but FileInputStream is part of the package and not the java.nio package.

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Thank you.
It is sorta covered in the JavaRanch Style Guide.
subject: FileNotFoundException and NoSuchFileException
Similar Threads
If conditional not branching correctly
Please explain me.
Problem running ByteStream example code in eclipse
File Not Found Exception in IO Stream