Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to get InputStream from a file with absolute path?

807607Oct 12 2006 — edited Oct 12 2006
Hi, guys:

If I have file with a absolute path that may be inside/outside
my Eclipse plugin, I want to get an InputStream from it. It just keeps giving me null for "is":

String absFilePath = "/D:/my_dir/.../sample_file.txt";
InputStream is = getClass().getResourceAsStream(absFilePath);

regards,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 9 2006
Added on Oct 12 2006
2 comments
474 views