/** * The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given FileId */ public SecurityDescriptor getSecurityInfo(SMB2FileId fileId, Set<SecurityInformation> securityInfo) throws SMBApiException { byte[] outputBuffer = queryInfo(fileId, SMB2_0_INFO_SECURITY, securityInfo, null, null).getOutputBuffer(); try { return SecurityDescriptor.read(new SMBBuffer(outputBuffer)); } catch (Buffer.BufferException e) { throw new SMBRuntimeException(e); } }
/** * The SecurityDescriptor(MS-DTYP 2.4.6 SECURITY_DESCRIPTOR) for the Given FileId */ public SecurityDescriptor getSecurityInfo(SMB2FileId fileId, Set<SecurityInformation> securityInfo) throws SMBApiException { byte[] outputBuffer = queryInfo(fileId, SMB2_0_INFO_SECURITY, securityInfo, null, null).getOutputBuffer(); try { return SecurityDescriptor.read(new SMBBuffer(outputBuffer)); } catch (Buffer.BufferException e) { throw new SMBRuntimeException(e); } }
/** * Get Share Information for the current Disk Share * * @return the ShareInfo */ public ShareInfo getShareInformation() throws SMBApiException { try (Directory directory = openDirectory("", of(FILE_READ_ATTRIBUTES), null, ALL, FILE_OPEN, null)) { byte[] outputBuffer = queryInfo( directory.getFileId(), SMB2QueryInfoRequest.SMB2QueryInfoType.SMB2_0_INFO_FILESYSTEM, null, null, FileSystemInformationClass.FileFsFullSizeInformation ).getOutputBuffer(); try { return ShareInfo.parseFsFullSizeInformation(new Buffer.PlainBuffer(outputBuffer, Endian.LE)); } catch (Buffer.BufferException e) { throw new SMBRuntimeException(e); } } }
/** * Get Share Information for the current Disk Share * * @return the ShareInfo */ public ShareInfo getShareInformation() throws SMBApiException { try (Directory directory = openDirectory("", of(FILE_READ_ATTRIBUTES), null, ALL, FILE_OPEN, null)) { byte[] outputBuffer = queryInfo( directory.getFileId(), SMB2QueryInfoRequest.SMB2QueryInfoType.SMB2_0_INFO_FILESYSTEM, null, null, FileSystemInformationClass.FileFsFullSizeInformation ).getOutputBuffer(); try { return ShareInfo.parseFsFullSizeInformation(new Buffer.PlainBuffer(outputBuffer, Endian.LE)); } catch (Buffer.BufferException e) { throw new SMBRuntimeException(e); } } }
public <F extends FileQueryableInformation> F getFileInformation(SMB2FileId fileId, Class<F> informationClass) throws SMBApiException { FileInformation.Decoder<F> decoder = FileInformationFactory.getDecoder(informationClass); byte[] outputBuffer = queryInfo( fileId, SMB2QueryInfoRequest.SMB2QueryInfoType.SMB2_0_INFO_FILE, null, decoder.getInformationClass(), null ).getOutputBuffer(); try { return decoder.read(new Buffer.PlainBuffer(outputBuffer, Endian.LE)); } catch (Buffer.BufferException e) { throw new SMBRuntimeException(e); } }
public <F extends FileQueryableInformation> F getFileInformation(SMB2FileId fileId, Class<F> informationClass) throws SMBApiException { FileInformation.Decoder<F> decoder = FileInformationFactory.getDecoder(informationClass); byte[] outputBuffer = queryInfo( fileId, SMB2QueryInfoRequest.SMB2QueryInfoType.SMB2_0_INFO_FILE, null, decoder.getInformationClass(), null ).getOutputBuffer(); try { return decoder.read(new Buffer.PlainBuffer(outputBuffer, Endian.LE)); } catch (Buffer.BufferException e) { throw new SMBRuntimeException(e); } }