[英]Best way to copy a file from Windows machine to Linux machine using java
My requirement is to copy a file that is on windows machine to Linux machine using the IP, User name and password of the windows machine using java code. 我的要求是使用Java代码使用Windows计算机的IP,用户名和密码将Windows计算机上的文件复制到Linux计算机。 I have the java code running on linux machine.
我有在Linux机器上运行的Java代码。 I want to know the best way to achieve this.
我想知道实现此目标的最佳方法。 What is the procedure to achieve this?
实现此目的的程序是什么?
您可以使用JCIFS从Linux或Windows上的Java访问Windows共享。
Your code is running on the Windows machine, right? 您的代码正在Windows计算机上运行,对吗? The most secure way would be to use SSH.
最安全的方法是使用SSH。 http://www.jcraft.com/jsch/ looks like a pretty good implementation.
http://www.jcraft.com/jsch/看起来很不错。 It's used by ant, maven.
它被蚂蚁,行家使用。 etc, to do the same thing.
等,做同样的事情。
On the other hand, if you're not creating a new build system, could I suggest that perhaps your build system (ant/maven/gradle) should be copying your files around for you? 另一方面,如果您不创建新的构建系统,我是否建议您的构建系统(ant / maven / gradle)应该为您复制文件?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.