Opening file using FileInputStream
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ankit_Doshi
Posted On:   Friday, September 7, 2001 03:45 AM

When I create an instance of the class FileInputStream, passing the file name as argument, it tries to look up for the file in the current directory only and if file is not present in the current directory, it throws FileNotFoundException.

Is it possible to make it search through the directories in say classpath or path??

Re: Opening file using FileInputStream

Posted By:   John_Zukowski  
Posted On:   Friday, September 7, 2001 06:18 AM

To look through the classpath, use getResource() to get a URL or getResourceAsStream() to get InputStream.
About | Sitemap | Contact