Class Share

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Direct Known Subclasses:
    DiskShare, PipeShare, PrinterShare

    public class Share
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Field Detail

      • ROOT_ID

        private static final SMB2FileId ROOT_ID
      • SUCCESS_OR_SYMLINK

        private static final StatusHandler SUCCESS_OR_SYMLINK
      • SUCCESS_OR_NO_MORE_FILES_OR_NO_SUCH_FILE

        private static final StatusHandler SUCCESS_OR_NO_MORE_FILES_OR_NO_SUCH_FILE
      • SUCCESS_OR_EOF

        private static final StatusHandler SUCCESS_OR_EOF
      • SUCCESS_OR_CLOSED

        private static final StatusHandler SUCCESS_OR_CLOSED
      • smbPath

        protected final SmbPath smbPath
      • treeId

        private final long treeId
      • session

        protected Session session
      • 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

        private final java.util.concurrent.atomic.AtomicBoolean disconnected
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException
      • isConnected

        public boolean isConnected()
      • getSmbPath

        public SmbPath getSmbPath()
      • getReadBufferSize

        int getReadBufferSize()
      • getReadTimeout

        long getReadTimeout()
      • getWriteBufferSize

        int getWriteBufferSize()
      • getCreateStatusHandler

        protected StatusHandler getCreateStatusHandler()
      • 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 code
        isFsCtl - true if the control code is an FSCTL; false if it is an IOCTL
        inData - 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 code
        isFsCtl - true if the control code is an FSCTL; false if it is an IOCTL
        inData - the control code dependent input data
        inOffset - the offset in inData where the input data starts
        inLength - the number of bytes from inData to send, starting at offset
        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 code
        isFsCtl - true if the control code is an FSCTL; false if it is an IOCTL
        inData - the control code dependent input data
        inOffset - the offset in inData where the input data starts
        inLength - the number of bytes from inData to send, starting at inOffset
        outData - the buffer where the response data should be written
        outOffset - the offset in outData where the output data should be written
        outLength - the maximum amount of data to write in outData, starting at outOffset
        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)
      • sendReceive

        private <T extends SMB2Packet> T sendReceive​(SMB2Packet request,
                                                     java.lang.String name,
                                                     java.lang.Object target,
                                                     StatusHandler statusHandler,
                                                     long timeout)
      • send

        private <T extends SMB2Packet> java.util.concurrent.Future<T> send​(SMB2Packet request)
      • receive

        <T extends SMB2Packet> T receive​(java.util.concurrent.Future<T> fut,
                                         java.lang.String name,
                                         java.lang.Object target,
                                         StatusHandler statusHandler,
                                         long timeout)
      • receive

        <T extends SMB2Packet> T receive​(java.util.concurrent.Future<T> fut,
                                         long timeout)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object