Package com.hierynomus.smbj.share
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 SMB2Dialect
private final AtomicBoolean
private static final EmptyByteChunkProvider
private final int
private final long
private static final SMB2FileId
protected Session
private final long
protected final SmbPath
private static final StatusHandler
private static final StatusHandler
private static final StatusHandler
private static final StatusHandler
private final int
private final long
protected final TreeConnect
private final long
private final int
private final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Future
<SMB2ChangeNotifyResponse> changeNotifyAsync
(SMB2FileId fileId, Set<SMB2CompletionFilter> completionFilter, Set<SMB2ChangeNotifyFlags> flags) void
close()
(package private) void
closeFileId
(SMB2FileId fileId) closeFileIdNoWait
(SMB2FileId fileId) (package private) SMB2CreateResponse
createFile
(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) boolean
(package private) void
flush
(SMB2FileId fileId) protected StatusHandler
(package private) SMB2Dialect
(package private) int
(package private) long
(package private) int
int
hashCode()
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.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.(package private) byte[]
ioctl
(SMB2FileId fileId, long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength) (package private) int
ioctl
(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) SMB2IoctlResponse
ioctl
(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) SMB2FileId
openFileId
(SmbPath path, SMB2ImpersonationLevel impersonationLevel, Set<AccessMask> accessMask, Set<FileAttributes> fileAttributes, Set<SMB2ShareAccess> shareAccess, SMB2CreateDisposition createDisposition, Set<SMB2CreateOptions> createOptions) (package private) SMB2QueryDirectoryResponse
queryDirectory
(SMB2FileId fileId, Set<SMB2QueryDirectoryRequest.SMB2QueryDirectoryFlags> flags, FileInformationClass informationClass, String searchPattern) (package private) SMB2QueryInfoResponse
queryInfo
(SMB2FileId fileId, SMB2QueryInfoRequest.SMB2QueryInfoType infoType, Set<SecurityInformation> securityInfo, FileInformationClass fileInformationClass, FileSystemInformationClass fileSystemInformationClass) (package private) SMB2ReadResponse
read
(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) SMB2LockResponse
sendLockRequest
(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) void
setInfo
(SMB2FileId fileId, SMB2SetInfoRequest.SMB2InfoType infoType, Set<SecurityInformation> securityInfo, FileInformationClass fileInformationClass, byte[] buffer) (package private) SMB2WriteResponse
write
(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:
close
in 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
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
null
if 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 ininData
where the input data startsinLength
- the number of bytes frominData
to send, starting atoffset
- Returns:
- the response data or
null
if 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 ininData
where the input data startsinLength
- the number of bytes frominData
to send, starting atinOffset
outData
- the buffer where the response data should be writtenoutOffset
- the offset inoutData
where 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
public int hashCode() -
equals
-