File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes java.io.FileNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "java.io.FileNotFoundException" Watch "java.io.FileNotFoundException" New topic
Author

java.io.FileNotFoundException

Jenny Lan
Greenhorn

Joined: Jun 25, 2012
Posts: 11
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

Joined: Jan 10, 2002
Posts: 61606
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jenny Lan
Greenhorn

Joined: Jun 25, 2012
Posts: 11
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

Joined: Jun 25, 2012
Posts: 11
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.
 
 
subject: java.io.FileNotFoundException