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 help writing to a textfile on a network share Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "help writing to a textfile on a network share" Watch "help writing to a textfile on a network share" New topic
Author

help writing to a textfile on a network share

Dave Bosky
Ranch Hand

Joined: Dec 16, 2003
Posts: 72
I'm trying to write to a text file on network share and keep receiving the
following error msg:

------------------------------------------------
IOException: java.io.FileNotFoundException:
\\myserver\dev\projects\projbefore\trans.txt
(The system cannot find the file specified)
------------------------------------------------

I store the share path in my web.xml file:



Any ideas? It must be something simple.

Thanks
Dave
Pedro Gongora
Greenhorn

Joined: Oct 03, 2003
Posts: 17
As far as I know, the url(?) notation //x/y/z is propietary of windows, and only windows explorer understand it. If you open a file with java io libraries, it will fail.

Why you don't try creating a network drive pointing to that location and use that in your code (ie. X:/y/z).
Jon Pincott
Greenhorn

Joined: Jul 28, 2004
Posts: 17
What user is your Tomcat running as? The default "LocalSystem" user doesn't have access to network resources, so you'll have to change to one that does.


SCJP SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help writing to a textfile on a network share