Using Filewriter class accross a network

is there a way to specify the filewriter class to accept a url as a creation parameter? i have my jsp pages served off a linux box running somba, so it is accessable to our NT domain. now, i want to drop a file file from the jsp server to a shared directory on another nt box. i've tryed some of the following code.

tofile = new PrintWriter( new FileWriter("\\\\servername\\directory\\test.txt" ) );

tofile = new PrintWriter( new FileWriter("//servername//directory/test.txt" ) );

any ideas? would it be possible to specify a specific url, and port? thanks!

[591 byte] By [wireframe] at [2007-9-26 2:24:44]
# 1
tofile = new PrintWriter( new FileWriter("//servername//directory/test.txt" ) );should be tofile = new PrintWriter( new FileWriter("//servername/directory/test.txt" ) );I have not tried it, but I think you have to map a driver name for the path first.
fayefun at 2007-6-29 9:34:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
In NT , you can try mapping a drive to the other machine and writing to that drive.For eg. map ur "F:" to the other NT machine and use file writer class to write to "F:/directory/filename"
sunilkg at 2007-6-29 9:34:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
thanks for the replies. as soon as my server gets back online, i'll be trying these out. i REALLY hope that you're not forced to map a drive, it kinda defeats the whole purpose of "going across the network".i'll post how it turns out.
wireframe at 2007-6-29 9:34:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

well, i've attempted to create the file using the "//servername/directory/file.txt" format and it hasn't worked. i've set the permissions for the NT directory so that anonymous users and everyone have full control, but that doesn't seem to have mattered.

i'm not getting a file at all. has anyone done this without mapping the drive on the server? that's the ONE thing i'm really trying to avoid. or maybe there's another class that can handle being passed the url. any ideas?

wireframe at 2007-6-29 9:34:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
i've seen people use the URL class to download files, but is it possible to write files with it? if someone could point me to a tutorial or a link to an example, it'd be greatly appreciated. thanks.
wireframe at 2007-6-29 9:34:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...