【发布时间】:2018-12-06 17:13:39
【问题描述】:
尝试使用 DFS URL 访问 SmbFile 时,jcifs 库失败。但是当我使用 dfsutil 返回的 UNC 时,它可以工作。
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication( domain, user, pass );
SmbFile folder = new SmbFile(path,auth);
如果 path 设置为
smb://mydomain.example.com/ourdfs/go/to/my/folder
调用失败
Exception in thread "main" jcifs.smb.SmbException: The network name cannot be found.
但是用解析后的名字调用是成功的
dfsutil diag viewdfspath \\mydomain.example.com\ourdfs\go\to\my\folder
The DFS Path <\\mydomain.example.com\ourdfs\go\to\my\folder>
resolves to -> <\\someserver.example.com\sharename$\my\folder>
那么以下网址适用于path
smb://someserver.example.com/sharename$/my/folder
如何设置 jcifs 以正确处理 DFS,即不必通过 dfsutil 翻译 url?
【问题讨论】:
标签: samba jcifs microsoft-distributed-file-system