Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

Saving image on localhost

843841May 12 2005 — edited May 13 2005
Hi,
I am attempting to save an image which I have created in a servlet on my localhost using the following code snippet
File f = new File("http:\\localhost:8080\\midp\\map.jpg");
ImageIO.write(bi, "jpg", f);
Where midp is a folder in my webapps folder containing my java files etc.
This generates a FileNotFoundException
The following code works fine and saves the image to the jakarta bin folder.
ImageIO.write(bi, "jpg", new File("map.jpg"));
Can anyone shed any light on what the correct file url should be?
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 10 2005
Added on May 12 2005
4 comments
216 views