[英]copy files from one solaris 9 to another using java
How to copy file(s) from one solaris 9 machine to another solaris 9 machine using only java? 如何仅使用Java将文件从一台solaris 9机器复制到另一台solaris 9机器?
We have ssh access to both machines. 我们可以通过ssh访问两台计算机。 The java program will run on one of those two machines.
Java程序将在这两台计算机之一上运行。
Update: rsync is not really an option. 更新:rsync并不是真正的选择。 can't install it easily (UNIX team is, hum, hard to deal with)
不能轻松安装(UNIX团队,哼,很难处理)
您可以使用Runtime.exec()启动rsync 。
Or you could use FTP. 或者您可以使用FTP。 Or you could mount some shared storage.
或者,您可以挂载一些共享存储。
use the ssh library jsch -- http://www.jcraft.com/jsch/ . 使用ssh库jsch- http://www.jcraft.com/jsch/ 。 This program is used by ant to do ssh transfers.
ant使用此程序进行ssh传输。 very good -- been there a long time(> 5 years), decent documentation.
很好-在那里呆了很长时间(> 5年),体面的文档。
if you're headed the way of FTP, here's 2 libraries 如果您是FTP的领导者,这里有2个库
1) http://www.geocities.com/SiliconValley/Code/9129/javabean/ftpbean/ 1) http://www.geocities.com/SiliconValley/Code/9129/javabean/ftpbean/
2) http://commons.apache.org/net/ 2) http://commons.apache.org/net/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.