简体   繁体   English

使用Java将文件从Windows计算机复制到Linux计算机的最佳方法

[英]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.

相关问题 使用 java.nio.file.Files.copy() 将文件从 Linux 复制到 Windows 远程机器 - Copy a file to a Windows remote machine from Linux using java.nio.file.Files.copy() 有没有办法从Windows或Linux机器上远程安装程序以编程到Windows机器? 最好是一些容易用Java编写的代码 - Is there a way to remotely install to program to a windows machine from both a windows or a linux machine? Preferably something easy to code in java 在Windows机器上使用Java Code将本地文件复制到Unix Server? - Copy local file to Unix Server using java Code on windows machine? 如何使用Java将Windows中的文件夹上传到Linux计算机 - how to upload a Folder from Windows to Linux machine using Java Java从Windows机器远程访问Linux机器 - Java remote access a linux machine from windows machine Java:从Linux机器访问Windows文件 - Java: Accessing Windows files from Linux machine 如何从 windows 机器到 linux 机器的 FTP 文件 - how to FTP file from windows machine to linux machine 使用Java将文件从本地窗口机器复制到远程Windows机器 - Copy files from local window machine to remote windows machine using java 通过Java将文件从Windows机器复制到另一个Windows机器 - Copying a file from a windows machine to another windows machine through java 使用Java运行时(在Windows计算机上)将linux命令发送到linux服务器 - Using java Runtime (on a windows machine) to send a linux command to a linux server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM