This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "FileNotFoundException and NoSuchFileException" Watch "FileNotFoundException and NoSuchFileException" New topic
Author

FileNotFoundException and NoSuchFileException

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305


java.io.FileNotFoundException: xanadu.txt (The system cannot find the file specified)


http://www.coderanch.com/t/558721//java/java-io-FileNotFoundException-java-nio
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
Bartender

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

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

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FileNotFoundException and NoSuchFileException
 
Similar Threads
exception
If conditional not branching correctly
File Not Found Exception in IO Stream
Please explain me.
Problem running ByteStream example code in eclipse