• Post Reply Bookmark Topic Watch Topic
  • New Topic

Denied Access writing file to a mapped drive

 
Toby Davis
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In using Win 2k with JDK 1.4.0, how do you prevent an "Access is Denied" FileNotFoundException in my app when writing a file to another computer (through mapped drive, for example)?
This is similar to a question posted by someone over a year ago here, which was never answered.
Here's a simplified code snippet below, taken out of a web app. This was also tested in a basic app writing to a console.

I'm not real clear on FilePermission class, if it's even applicable here... but the drive has already been mapped so I'm confused about the exception being thrown.
Thanks!
---
[ October 20, 2002: Message edited by: Toby Davis ]
 
Toby Davis
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears there is no Samba (Win networking) support in Java, at least officially.
Of course, there's always workarounds... but nothing I can think of that would work on a production environment. I'm not a C++ programmer so JNI is out...
Any ideas, if any, are welcome.
 
Michael Zalewski
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out http://jcifs.samba.org
 
Toby Davis
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saw it in the Java.sun.com forum post, but didn't think of it since I had used a much older version unsuccessfully.
However, seems that 0.6.6 is working fairly well. I hope it's good for a production environment.
Thanks.
---
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!