如何在其他Windows服务器中创建文件?服务器有用户名,密码,IP地址和特定目录。
答案 0 :(得分:1)
SAMBA! Braziiillll,Braziiiiiiillll!
这样的事情:
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...
注意:首先需要共享目标文件夹!
答案 1 :(得分:0)
正如@orm已经指出的那样,这里已经回答FTP upload via sockets
基本上,您可以重复使用Apache Commons Net之类的现有库来执行此操作。有关使用FTP客户端的详细信息,请查看documentation for the class FTPClient class。