• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Denied Access writing file to a mapped drive

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out http://jcifs.samba.org
 
Toby Davis
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
---
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic