Or if you can find Sample.txt as a resource, but want it as a File, you can use
Note that this doesn't work for all resources (if it does work at all?). The URL could easily point inside a jar-file, or be a HTTP URL (for example in the case of Webstart). Those resources cannot be represented as a File object.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joined: Jan 30, 2000
True, as long as I was checking for url != null I should have also verified that:
[ May 09, 2008: Message edited by: Jim Yingst ]
subject: File vs InputStream when getting a reference to file under the class path