aspose file tools
The moose likes Java in General and the fly likes transfer file from one server(Linux) to another server(Linux) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "transfer file from one server(Linux) to another server(Linux)" Watch "transfer file from one server(Linux) to another server(Linux)" New topic
Author

transfer file from one server(Linux) to another server(Linux)

Sajan Patel
Ranch Hand

Joined: Oct 25, 2004
Posts: 77
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 ]
Frank Jorga
Greenhorn

Joined: Dec 17, 2004
Posts: 3
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)
 
I agree. Here's the link: jrebel
 
subject: transfer file from one server(Linux) to another server(Linux)
 
Similar Threads
DB2 jdbc driver 6.2 on linux red Hat 7.2 it doesn't Work with Iplanet web server 6.0
DB2 jdbc driver 6.2 on linux red Hat 7.2 it doesn't Work with Iplanet web server 6.0
Ant and Eclipse
NX:exceptions while the registering and binding -process
DB2 jdbc driver 6.2 on linux red Hat 7.2 it doesn't Work with Iplanet web server 6.0