【发布时间】:2016-02-18 07:16:53
【问题描述】:
我阅读了 jCIFS 关于 smbfile 的 api,但我还没有找到如何仅使用文件名获取完整的 smb 路径。 我希望它返回“smb://aaa.bbb.com/sharedFolder/picture.jpg” 虽然它返回“smb://aaa.bbb.com/picture.jpg” 有代码:
String user = "user";
String password = "password";
String sharedFolder = "sharedFolder/";
String path = "smb://aaa.bbb.com/";
String fileName = "picture.jpg";
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("", user, password);
SmbFile smb = new SmbFile(path, auth);
SmbFile smbFile = new SmbFile(smb, fileName);
//String canonicalPath = smb.getCanonicalPath();
String filePath = smbFile.getUncPath();
【问题讨论】:
-
我相信远程只能看到共享名称,而不是共享系统上共享文件夹的名称。