• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.io.FileNotFoundException

 
Jenny Lan
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new in Servlets, please help. I got File Not found issue, I am sure I have a gif file C:\temp\new1.gif. Please see the errors and the codes below.

java.io.FileNotFoundException: C:\app\eclipse-jee-juno-win32\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Images\C:\temp\new1.gif (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getRealPath() is used to find the actual path of a resource that is within the web app.

As you already have a full and absolute path to the file, it's not needed.

 
Jenny Lan
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information. Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.

I've gone ahead and added the code tags for you. See how much easier the code is to read?


I am sorry, will use code tags next time.
 
Jenny Lan
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:getRealPath() is used to find the actual path of a resource that is within the web app.

As you already have a full and absolute path to the file, it's not needed.



Thank you very much. It helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic