HELP! I need to get rid of my headache.

My JSP program works in this way:

1. It is runing in Server A and will import a text file from Server B.

--I make this part work by using java.net.URL. I import the file and save it on the hard drive of Server A.

2. After obtaining the file from server B, my JSP program should be able to create a back up file under the same path on server B.

--Is there methods to rename a file on another server. I think file.Renameto() method won't work here because the I only have the URL path. Is there a file method accepting an URL as parameter, or something like that? Or I have to send the file back to the same place from where I get this file. This sounds stupid to me, because in this way I am going to import a file and send it back right after I get it and, the only purpose is to make a back up file on server B.

3. The program will process the data in the file on server A. But it also should be able to create a new file on server B, which contains the error messages occured during data processing on Server A.

--can we create a file on another server? If we can, then how? Anybody has sample codes?

Thanks.

[1176 byte] By [huangjjing] at [2007-9-26 3:31:22]
# 1

If you have FTP services running on Server B - then you could do all yoy need via FTP Client commands

you can get(copy) file from ServerA to ServerB (Backup done)

you can rename file on ServerA

You can process file, build error file and put(write) file back to ServerA

try the NetComponents libraries at

http://www.savarese.org/oro/

Hope this helps

Stefan Maric at 2007-6-29 11:57:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks for reply. But my problem is: we don't have FTP service on the server B side. Do you have any other idea except using FTP?
huangjjing at 2007-6-29 11:57:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

You could build the File Transfer directly into your Client/Server applications

So you would need build/decode some messages that get sent across the socket to enable delivery/control of the file(s)

ie use FileInput/OutputStream

if you decide to go this way it might be better to have 2 sockets - one to carry the control/responses & the other just to transfer the file(s)

Stefan Maric at 2007-6-29 11:57:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
You could also use JMS to transfer the files. I'm not quite sure how effective this would be but I know it's possible.
Enygma42 at 2007-6-29 11:57:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...