问题描述
我的目标是通过 smbj 查询 SMB 共享的配额信息。我曾尝试寻找可以调用以获取此信息的现有方法,但似乎找不到任何方法。我也开始创建一个新的 SMB2QueryInfoRequest,但老实说我真的不知道如何正确设置它。我想知道是否有人曾经使用 smbj 来获取配额信息?下面是我尝试做的事情的片段(未成功)。任何帮助将不胜感激。
try (Connection connection = client.connect(smbHost)) {
AuthenticationContext ac = new AuthenticationContext(smbUser,smbPass.tochararray(),smbHost);
Session session = connection.authenticate(ac);
// Connect to Share
try (diskShare share = (diskShare) session.connectShare(smbFolder)) {
/*
* SMB2QueryInfoRequest(SMB2Dialect smbDialect,long sessionId,long treeId,SMB2FileId fileId,* SMB2QueryInfoType infoType,FileinformationClass fileinformationClass,FileSysteminformationClass fileSysteminformationClass,* byte[] inputBuffer,Set<Securityinformation> securityinformation)
*/
SMB2FileId fileId = new SMB2FileId();
byte[] buffer = new byte[64];
SMB2QueryInfoRequest query = new SMB2QueryInfoRequest(SMB2Dialect.SMB_2_0_2,session.getSessionId(),fileId,SMB2QueryInfoType.SMB2_0_INFO_QUOTA,null,buffer,null);
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)