Class Share
java.lang.Object
com.hierynomus.smbj.share.Share
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
DiskShare, PipeShare, PrinterShare
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SMB2Dialectprivate final AtomicBooleanprivate static final EmptyByteChunkProviderprivate final intprivate final longprivate static final SMB2FileIdprotected Sessionprivate final longprotected final SmbPathprivate static final StatusHandlerprivate static final StatusHandlerprivate static final StatusHandlerprivate static final StatusHandlerprivate final intprivate final longprotected final TreeConnectprivate final longprivate final intprivate final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Future<SMB2ChangeNotifyResponse> changeNotifyAsync(SMB2FileId fileId, Set<SMB2CompletionFilter> completionFilter, Set<SMB2ChangeNotifyFlags> flags) voidclose()(package private) voidcloseFileId(SMB2FileId fileId) closeFileIdNoWait(SMB2FileId fileId) (package private) SMB2CreateResponsecreateFile(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) boolean(package private) voidflush(SMB2FileId fileId) protected StatusHandler(package private) SMB2Dialect(package private) int(package private) long(package private) intinthashCode()byte[]ioctl(long ctlCode, boolean isFsCtl, byte[] inData) Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.byte[]ioctl(long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength) Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.intioctl(long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength, byte[] outData, int outOffset, int outLength) Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.(package private) byte[]ioctl(SMB2FileId fileId, long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength) (package private) intioctl(SMB2FileId fileId, long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength, byte[] outData, int outOffset, int outLength) (package private) byte[]ioctl(SMB2FileId fileId, long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength, int maxOutputResponse) (package private) SMB2IoctlResponseioctl(SMB2FileId fileId, long ctlCode, boolean isFsCtl, ByteChunkProvider inputData, int maxOutputResponse) ioctlAsync(long ctlCode, boolean isFsCtl, ByteChunkProvider inputData) (package private) Future<SMB2IoctlResponse> ioctlAsync(SMB2FileId fileId, long ctlCode, boolean isFsCtl, ByteChunkProvider inputData, int maxOutputResponse) boolean(package private) SMB2FileIdopenFileId(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) (package private) SMB2QueryDirectoryResponsequeryDirectory(SMB2FileId fileId, Set<SMB2QueryDirectoryRequest.SMB2QueryDirectoryFlags> flags, FileInformationClass informationClass, String searchPattern) queryInfo(SMB2FileId fileId, SMB2QueryInfoRequest.SMB2QueryInfoType infoType, Set<SecurityInformation> securityInfo, FileInformationClass fileInformationClass, FileSystemInformationClass fileSystemInformationClass) (package private) SMB2ReadResponseread(SMB2FileId fileId, long offset, int length) (package private) Future<SMB2ReadResponse> readAsync(SMB2FileId fileId, long offset, int length) (package private) <T extends SMB2Packet>
T(package private) <T extends SMB2Packet>
Treceive(Future<T> fut, String name, Object target, StatusHandler statusHandler, long timeout) private <T extends SMB2Packet>
Future<T> send(SMB2Packet request) (package private) SMB2LockResponsesendLockRequest(SMB2FileId fileId, short lockSequenceNumber, int lockSequenceIndex, List<SMB2LockElement> lockElements) private <T extends SMB2Packet>
TsendReceive(SMB2Packet request, String name, Object target, StatusHandler statusHandler, long timeout) (package private) voidsetInfo(SMB2FileId fileId, SMB2SetInfoRequest.SMB2InfoType infoType, Set<SecurityInformation> securityInfo, FileInformationClass fileInformationClass, byte[] buffer) (package private) SMB2WriteResponsewrite(SMB2FileId fileId, ByteChunkProvider provider) (package private) Future<SMB2WriteResponse> writeAsync(SMB2FileId fileId, ByteChunkProvider provider)
-
Field Details
-
ROOT_ID
-
SUCCESS_OR_SYMLINK
-
SUCCESS_OR_NO_MORE_FILES_OR_NO_SUCH_FILE
-
SUCCESS_OR_EOF
-
SUCCESS_OR_CLOSED
-
smbPath
-
treeConnect
-
treeId
private final long treeId -
session
-
dialect
-
readBufferSize
private final int readBufferSize -
readTimeout
private final long readTimeout -
writeBufferSize
private final int writeBufferSize -
writeTimeout
private final long writeTimeout -
transactBufferSize
private final int transactBufferSize -
transactTimeout
private final long transactTimeout -
sessionId
private final long sessionId -
disconnected
-
EMPTY
-
-
Constructor Details
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
isConnected
public boolean isConnected() -
getSmbPath
-
getTreeConnect
-
getReadBufferSize
int getReadBufferSize() -
getReadTimeout
long getReadTimeout() -
getWriteBufferSize
int getWriteBufferSize() -
openFileId
SMB2FileId openFileId(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) -
createFile
SMB2CreateResponse createFile(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) -
getCreateStatusHandler
-
flush
- Throws:
SMBApiException
-
closeFileId
- Throws:
SMBApiException
-
closeFileIdNoWait
- Throws:
SMBApiException
-
queryInfo
public SMB2QueryInfoResponse queryInfo(SMB2FileId fileId, SMB2QueryInfoRequest.SMB2QueryInfoType infoType, Set<SecurityInformation> securityInfo, FileInformationClass fileInformationClass, FileSystemInformationClass fileSystemInformationClass) -
setInfo
void setInfo(SMB2FileId fileId, SMB2SetInfoRequest.SMB2InfoType infoType, Set<SecurityInformation> securityInfo, FileInformationClass fileInformationClass, byte[] buffer) -
queryDirectory
SMB2QueryDirectoryResponse queryDirectory(SMB2FileId fileId, Set<SMB2QueryDirectoryRequest.SMB2QueryDirectoryFlags> flags, FileInformationClass informationClass, String searchPattern) -
write
-
writeAsync
-
read
-
readAsync
-
ioctl
public byte[] ioctl(long ctlCode, boolean isFsCtl, byte[] inData) Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.- Parameters:
ctlCode- the control codeisFsCtl- true if the control code is an FSCTL; false if it is an IOCTLinData- the control code dependent input data- Returns:
- the response data or
nullif the control code did not produce a response
-
ioctl
public byte[] ioctl(long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength) Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.- Parameters:
ctlCode- the control codeisFsCtl- true if the control code is an FSCTL; false if it is an IOCTLinData- the control code dependent input datainOffset- the offset ininDatawhere the input data startsinLength- the number of bytes frominDatato send, starting atoffset- Returns:
- the response data or
nullif the control code did not produce a response
-
ioctl
public int ioctl(long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength, byte[] outData, int outOffset, int outLength) Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.- Parameters:
ctlCode- the control codeisFsCtl- true if the control code is an FSCTL; false if it is an IOCTLinData- the control code dependent input datainOffset- the offset ininDatawhere the input data startsinLength- the number of bytes frominDatato send, starting atinOffsetoutData- the buffer where the response data should be writtenoutOffset- the offset inoutDatawhere the output data should be writtenoutLength- the maximum amount of data to write inoutData, starting atoutOffset- Returns:
- the number of bytes written to
outData
-
ioctl
byte[] ioctl(SMB2FileId fileId, long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength) -
ioctl
byte[] ioctl(SMB2FileId fileId, long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength, int maxOutputResponse) -
ioctl
int ioctl(SMB2FileId fileId, long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength, byte[] outData, int outOffset, int outLength) -
ioctl
SMB2IoctlResponse ioctl(SMB2FileId fileId, long ctlCode, boolean isFsCtl, ByteChunkProvider inputData, int maxOutputResponse) -
ioctlAsync
public Future<SMB2IoctlResponse> ioctlAsync(long ctlCode, boolean isFsCtl, ByteChunkProvider inputData) -
ioctlAsync
Future<SMB2IoctlResponse> ioctlAsync(SMB2FileId fileId, long ctlCode, boolean isFsCtl, ByteChunkProvider inputData, int maxOutputResponse) -
sendLockRequest
SMB2LockResponse sendLockRequest(SMB2FileId fileId, short lockSequenceNumber, int lockSequenceIndex, List<SMB2LockElement> lockElements) -
changeNotifyAsync
Future<SMB2ChangeNotifyResponse> changeNotifyAsync(SMB2FileId fileId, Set<SMB2CompletionFilter> completionFilter, Set<SMB2ChangeNotifyFlags> flags) -
send
-
receive
-
getDialect
SMB2Dialect getDialect() -
hashCode
-
equals
-