tags:

views:

684

answers:

4

How to copy file(s) from one solaris 9 machine to another solaris 9 machine using only java?

We have ssh access to both machines. The java program will run on one of those two machines.

Update: rsync is not really an option. can't install it easily (UNIX team is, hum, hard to deal with)

+1  A: 

You could use Runtime.exec() to launch rsync.

Paul Croarkin
You could lanunch scp as well, I guess. If you really only have the ability to install your program on one of the pair of computers, using exec() is probably the simplest solution.
Mark Bessey
+1  A: 

Or you could use FTP. Or you could mount some shared storage.

oxbow_lakes
We're going that route. Recommendations on FTP classes for java (1.5) for this setup?
Christopher Mahan
no need to do FTP. if you still need to do FTP read below
anjanb
+1  A: 

use the ssh library jsch -- http://www.jcraft.com/jsch/. This program is used by ant to do ssh transfers. very good -- been there a long time(> 5 years), decent documentation.

anjanb
+1  A: 

if you're headed the way of FTP, here's 2 libraries

1) http://www.geocities.com/SiliconValley/Code/9129/javabean/ftpbean/
2) http://commons.apache.org/net/

anjanb
thanks. I'll definitely check them out.
Christopher Mahan