java - 在另一台服务器上创建文件

标签 java windows ftp

如何在另一个 Windows 服务器中创建文件?服务器有用户名、密码、IP 地址和特定目录。

最佳答案

SAMBA !巴西IIIIII,巴西IIIIIIIII!

类似这样的事情:

String userPass = "username:password";
String filePath = "smb://ip_address/shared_folder/file_name";

NtlmPasswordAuthentication authentication = new NtlmPasswordAuthentication(userPass);
SmbFile smbFile = new SmbFile(filePath, authentication);
SmbFileOutputStream smbFileOutputStream = new SmbFileOutputStream(smbFile);
PrintStream printStream = new PrintStream(smbFileOutputStream);
//You should be good from this point on...             

注意:需要首先共享目标文件夹!

关于java - 在另一台服务器上创建文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7477542/

相关文章:

ssh - Apache Airflow 无法通过 FTP/SFTP 建立与远程主机的连接

java - 如何将 Collections.synchronizedMap(new HashMap()) 转换为 Hash Map

python-3.x - Pythonw、pyw 和 arg,/B 不会使 python 的 http-server 在后台运行

c++ - 在QT中读取窗口的注册表

windows - 通过 docker-compose 将 build-args 传递给 Dockerfile 的奇怪行为

c# - 带通配符的 FTP 目录部分列表

python - 使用 FTP 后端的 Django 文件上传

java - 多线程写入多个文件,但是会互相影响

java - Android 房间 - 错误 : Cannot figure out how to save this field into database

java - 为什么这段代码没有给出任何异常?