|                                                                                                              1
 18
 19  package jcifs.smb;
 20
 21  class Trans2SetFileInformation extends SmbComTransaction {
 22
 23      static final int SMB_FILE_BASIC_INFO = 0x101;
 24
 25      private int fid;
 26      private int attributes;
 27      private long createTime, lastWriteTime;
 28
 29      Trans2SetFileInformation( int fid, int attributes, long createTime, long lastWriteTime ) {
 30          this.fid = fid;
 31          this.attributes = attributes;
 32          this.createTime = createTime;
 33          this.lastWriteTime = lastWriteTime;
 34          command = SMB_COM_TRANSACTION2;
 35          subCommand = TRANS2_SET_FILE_INFORMATION;
 36          maxParameterCount = 6;
 37          maxDataCount = 0;
 38          maxSetupCount = (byte)0x00;
 39      }
 40
 41      int writeSetupWireFormat( byte[] dst, int dstIndex ) {
 42          dst[dstIndex++] = subCommand;
 43          dst[dstIndex++] = (byte)0x00;
 44          return 2;
 45      }
 46      int writeParametersWireFormat( byte[] dst, int dstIndex ) {
 47          int start = dstIndex;
 48
 49          writeInt2( fid, dst, dstIndex );
 50          dstIndex += 2;
 51          writeInt2( SMB_FILE_BASIC_INFO, dst, dstIndex );
 52          dstIndex += 2;
 53          writeInt2( 0, dst, dstIndex );
 54          dstIndex += 2;
 55
 56          return dstIndex - start;
 57      }
 58      int writeDataWireFormat( byte[] dst, int dstIndex ) {
 59          int start = dstIndex;
 60
 61          writeTime( createTime, dst, dstIndex ); dstIndex += 8;
 62          writeInt8( 0L, dst, dstIndex ); dstIndex += 8;
 63          writeTime( lastWriteTime, dst, dstIndex ); dstIndex += 8;
 64          writeInt8( 0L, dst, dstIndex ); dstIndex += 8;
 65
 67          writeInt2( 0x80 | attributes, dst, dstIndex ); dstIndex += 2;
 68
 69          writeInt8( 0L, dst, dstIndex ); dstIndex += 6;
 70
 71
 73
 74          return dstIndex - start;
 75      }
 76      int readSetupWireFormat( byte[] buffer, int bufferIndex, int len ) {
 77          return 0;
 78      }
 79      int readParametersWireFormat( byte[] buffer, int bufferIndex, int len ) {
 80          return 0;
 81      }
 82      int readDataWireFormat( byte[] buffer, int bufferIndex, int len ) {
 83          return 0;
 84      }
 85      public String
  toString() { 86          return new String
  ( "Trans2SetFileInformation[" + super.toString() + 87              ",fid=" + fid + "]" );
 88      }
 89  }
 90
                                                                                                                                                                                                             |                                                                       
 
 
 
 
 
                                                                                   Popular Tags                                                                                                                                                                                              |