Module jcifs

Class Smb2CloseResponse

All Implemented Interfaces:
CommonServerMessageBlock, CommonServerMessageBlockResponse, SmbBasicFileInfo, Message, Response

public class Smb2CloseResponse extends ServerMessageBlock2Response implements SmbBasicFileInfo
SMB2 Close response message. This response acknowledges the closing of a file and provides final file attributes.
Author:
mbechler
  • Field Details

    • SMB2_CLOSE_FLAG_POSTQUERY_ATTIB

      public static final int SMB2_CLOSE_FLAG_POSTQUERY_ATTIB
      Flag to query attributes after close
      See Also:
  • Constructor Details

    • Smb2CloseResponse

      public Smb2CloseResponse(Configuration config, byte[] fileId, String fileName)
      Constructs a close response
      Parameters:
      config - The configuration to use
      fileId - The file ID that was closed
      fileName - The name of the file that was closed
  • Method Details

    • getCloseFlags

      public final int getCloseFlags()
      Get the close flags
      Returns:
      the closeFlags
    • getCreationTime

      public final long getCreationTime()
      Get the file creation time
      Returns:
      the creationTime
    • getCreateTime

      public final long getCreateTime()
      Gets the file creation time.
      Specified by:
      getCreateTime in interface SmbBasicFileInfo
      Returns:
      file create time
      See Also:
    • getLastAccessTime

      public final long getLastAccessTime()
      Description copied from interface: SmbBasicFileInfo
      Gets the file last access time.
      Specified by:
      getLastAccessTime in interface SmbBasicFileInfo
      Returns:
      the lastAccessTime
    • getLastWriteTime

      public final long getLastWriteTime()
      Description copied from interface: SmbBasicFileInfo
      Gets the file last write time.
      Specified by:
      getLastWriteTime in interface SmbBasicFileInfo
      Returns:
      the lastWriteTime
    • getChangeTime

      public final long getChangeTime()
      Get the file change time
      Returns:
      the changeTime
    • getAllocationSize

      public final long getAllocationSize()
      Get the file allocation size
      Returns:
      the allocationSize
    • getEndOfFile

      public final long getEndOfFile()
      Get the end of file position
      Returns:
      the endOfFile
    • getFileId

      public byte[] getFileId()
      Get the file ID
      Returns:
      the fileId
    • getFileName

      public String getFileName()
      Get the file name
      Returns:
      the fileName
    • getSize

      public long getSize()
      Gets the file size in bytes.
      Specified by:
      getSize in interface SmbBasicFileInfo
      Returns:
      file size
      See Also:
    • getFileAttributes

      public int getFileAttributes()
      Get the file attributes
      Returns:
      the fileAttributes
    • getAttributes

      public int getAttributes()
      Gets the file attributes.
      Specified by:
      getAttributes in interface SmbBasicFileInfo
      Returns:
      file attributes
      See Also:
    • writeBytesWireFormat

      protected int writeBytesWireFormat(byte[] dst, int dstIndex)
      Writes the message body to the wire format.
      Specified by:
      writeBytesWireFormat in class ServerMessageBlock2
      Parameters:
      dst - the destination buffer
      dstIndex - the starting position in the buffer
      Returns:
      number of bytes written
      See Also:
    • readBytesWireFormat

      protected int readBytesWireFormat(byte[] buffer, int bufferIndex) throws SMBProtocolDecodingException
      Reads the message body from the wire format.
      Specified by:
      readBytesWireFormat in class ServerMessageBlock2
      Parameters:
      buffer - the buffer to read from
      bufferIndex - the starting position in the buffer
      Returns:
      number of bytes read
      Throws:
      SMBProtocolDecodingException - if decoding fails
      See Also: