我使用https://github.com/hierynomus/smbj进行 samba 访问。我只想获取目标目录的子文件夹。下面的代码我得到“..”,“。” 和所有文件 - 有没有一种优雅的方式来获取子目录?
SmbConfig config = SmbConfig.builder().withMultiProtocolNegotiate(true).build();
smbClient = new SMBClient(config);
Connection connection = smbClient.connect(smbServerName);
AuthenticationContext ac = new AuthenticationContext(smbUser, smbPassword.toCharArray(), smbDomain);
Session session = connection.authenticate(ac);
share = (DiskShare) session.connectShare(smbShareName);
List<FileIdBothDirectoryInformation> subs = share.list("mydirWhichSubDirsIwant");