Class DiskEntry

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    Directory, File

    public abstract class DiskEntry
    extends Open<DiskShare>
    • Nested Class Summary

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.slf4j.Logger logger  
    • Method Summary

      Modifier and Type Method Description
      void closeNoWait()  
      void createHardlink​(java.lang.String linkname)
      Creates hard link for receiver.
      This method is a shortcut for DiskEntry#createHardlink(linkname, false)
      void createHardlink​(java.lang.String linkname, boolean replaceIfExist)
      Creates hard link for receiver.
      void deleteOnClose()  
      boolean equals​(java.lang.Object obj)  
      void flush()  
      DiskShare getDiskShare()  
      FileAllInformation getFileInformation()  
      <F extends FileQueryableInformation>
      F
      getFileInformation​(java.lang.Class<F> informationClass)  
      java.lang.String getFileName()
      Deprecated.
      as of 0.11.0 use getUncPath() instead.
      java.lang.String getPath()
      Gets the relative path of this disk entry.
      SecurityDescriptor getSecurityInformation​(java.util.Set<SecurityInformation> securityInfo)  
      java.lang.String getUncPath()
      Gets the UNC path of this disk entry.
      int hashCode()  
      byte[] ioctl​(int 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​(int 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.
      byte[] ioctl​(int ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength, int maxOutputResponse)
      Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.
      void rename​(java.lang.String newName)  
      void rename​(java.lang.String newName, boolean replaceIfExist)  
      void rename​(java.lang.String newName, boolean replaceIfExist, long rootDirectory)  
      <F extends FileSettableInformation>
      void
      setFileInformation​(F information)  
      void setSecurityInformation​(SecurityDescriptor securityDescriptor)  
      void setSecurityInformation​(SecurityDescriptor securityDescriptor, java.util.Set<SecurityInformation> securityInfo)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
    • Method Detail

      • closeNoWait

        public void closeNoWait()
      • getFileName

        @Deprecated
        public java.lang.String getFileName()
        Deprecated.
        as of 0.11.0 use getUncPath() instead.
        Gets the UNC path of this disk entry.
        Returns:
        The UNC path of this disk entry.
      • getUncPath

        public java.lang.String getUncPath()
        Gets the UNC path of this disk entry.
        Returns:
        The UNC path of this disk entry. Example: \\192.168.1.51\share\folder0\test1.txt
      • getPath

        public java.lang.String getPath()
        Gets the relative path of this disk entry.
        Returns:
        The relative path of this disk entry. Example: folder0/test1.txt
      • getDiskShare

        public DiskShare getDiskShare()
      • rename

        public void rename​(java.lang.String newName,
                           boolean replaceIfExist,
                           long rootDirectory)
                    throws SMBApiException
        Throws:
        SMBApiException
      • createHardlink

        public void createHardlink​(java.lang.String linkname)
                            throws SMBApiException
        Creates hard link for receiver.
        This method is a shortcut for DiskEntry#createHardlink(linkname, false)
        Parameters:
        linkname - the path to the hard link relative to share
        Throws:
        SMBApiException
      • createHardlink

        public void createHardlink​(java.lang.String linkname,
                                   boolean replaceIfExist)
                            throws SMBApiException
        Creates hard link for receiver.
        Parameters:
        linkname - the path to the hard link relative to share
        replaceIfExist - if true replaces existing entry.
        Throws:
        SMBApiException
      • ioctl

        public byte[] ioctl​(int 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 byte[] ioctl​(int ctlCode,
                            boolean isFsCtl,
                            byte[] inData,
                            int inOffset,
                            int inLength,
                            int maxOutputResponse)
        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
        maxOutputResponse - the maximum number of bytes that the server can return for the output data in the SMB2 IOCTL Response.
        Returns:
        the response data or null if the control code did not produce a response
      • ioctl

        public int ioctl​(int 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
      • flush

        public void flush()
      • deleteOnClose

        public void deleteOnClose()
      • 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