transfer file from one server(Linux) to another server(Linux)
Joined: Oct 25, 2004
Hi, I have one application which create one flat file with tab and copy that file from one server12(Linux) where my application is running to another server56(Linux).
My Application is java base. it collect some informations from user then write that informations to one file and copy it to another server where we have our LDAP e-dir. As e-dir have all records it doesnt support FTP.
I have heard something about scp command in linux to copy securely but i dont know how to run that comman from servlet base java application and I am not sure this is possible or not.
Can any one tell how to copy this file from one server to another. [ December 10, 2004: Message edited by: Sajan Patel ]
Joined: Dec 17, 2004
Write a servet Pair (one sender one reciever) install a (selfmade) ssl key if you need security and drop the file via HTTP POST to the other machine.
On the Server Side consider HTTPUrlConnection which is a 20 Lines-of-code to kick a binary File out.
On The client side catch DoPost, route you input Stream to a byte array and write this to your file (50 LOC)