Skip to Main Content

Java Development Tools

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!

accessing files under public_html

Dev83Aug 25 2011 — edited Aug 27 2011
Guys,
I have a 'images' folder under 'public_html' directory.

I have a file called 'example.jpg' in the following directory structure: 'public_html/images/example.jpg'

InputStream is = new FileInputStream(<example.jpg path>);

I tried providing InputStream is = new FileInputStream("/images/example.jpg");

But it throws java.io.FileNotFoundException: \images\example.jpg (The system cannot find the path specified)

How can i specify the path correctly?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2011
Added on Aug 25 2011
9 comments
516 views