如何将文件从本地非SMB文件夹移动到服务器中的SMB位置?
下面的代码不起作用,但就像我所追求的那样。我能够验证smb的位置。
String sourceFile="target/abc.xml";
String smbDestinationFile="sharePath/abc/smblocation/xyz.xml";
SmbFile sTargetFile = performAuthenticationAndChecks(destinationFile, domain, domainUsername,
domainPassword);
Files.move(Paths.get(sourceFile), (Path) sTargetFile);我知道这个错误:
java.lang.ClassCastException: jcifs.smb1.smb1.SmbFile cannot be cast to java.nio.file.Path发布于 2022-02-23 06:09:57
你可能在使用一个过时的图书馆。寻找可维护的替代方案,如JFileServer或jNQ。
https://stackoverflow.com/questions/71223796
复制相似问题