[英]Can see the network share directly, but not from JAVA >> jcifs.smb.SmbException: The network name cannot be found
I can expand the code if needed, but generally this is what is happening如果需要,我可以扩展代码,但通常情况就是这样
(from Windows machine) (来自Windows机器)
explorer \\hostname\folder1\folder2
=> works, I can see the contents => 有效,我可以看到内容
from Java来自 Java
import jcifs.smb.*;
<..snip..>
String dest = "smb://hostname//folder1//folder2//file1.txt";
NtlmPasswordAuthentication authentication = new NtlmPasswordAuthentication(domain,username,password);
SmbFile file = new SmbFile(dest, authentication);
jcifs.smb.SmbException: The.network name cannot be found jcifs.smb.SmbException: 找不到网络名称
Does this mean something is not supported?这是否意味着不支持某些内容? Tried single and double slashes.
试过单斜线和双斜线。
The double slashes are required only after the protocol.只有在协议之后才需要双斜线。 Look at the difference here:
看看这里的区别:
smb://hostname//folder1//folder2//file1.txt
smb://hostname/folder1/folder2/file1.txt
Also be aware that jcifs is a SMB implementation purely in Java. While the original jcifs library is no longer maintained (and since Windows 10 connections based on that old protocol are no longer accepted) be sure to use a more up to date version of the library, such as jcifs-ng .另请注意,jcifs 是纯粹在 Java 中的 SMB 实现。虽然不再维护原始 jcifs 库(并且自 Windows 起不再接受基于该旧协议的 10 个连接),请务必使用更新版本的库,例如jcifs-ng 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.