1 18 19 package jcifs.smb; 20 21 import java.util.Date ; 22 import jcifs.util.Hexdump; 23 24 class SmbComQueryInformationResponse extends ServerMessageBlock implements Info { 25 26 private int fileAttributes = 0x0000; 27 private long lastWriteTime = 0L; 28 private long serverTimeZoneOffset; 29 private int fileSize = 0; 30 31 SmbComQueryInformationResponse( long serverTimeZoneOffset ) { 32 this.serverTimeZoneOffset = serverTimeZoneOffset; 33 command = SMB_COM_QUERY_INFORMATION; 34 } 35 36 public int getAttributes() { 37 return fileAttributes; 38 } 39 public long getCreateTime() { 40 return lastWriteTime + serverTimeZoneOffset; 41 } 42 public long getLastWriteTime() { 43 return lastWriteTime + serverTimeZoneOffset; 44 } 45 public long getSize() { 46 return fileSize; 47 } 48 int writeParameterWordsWireFormat( byte[] dst, int dstIndex ) { 49 return 0; 50 } 51 int writeBytesWireFormat( byte[] dst, int dstIndex ) { 52 return 0; 53 } 54 int readParameterWordsWireFormat( byte[] buffer, int bufferIndex ) { 55 if( wordCount == 0 ) { 56 return 0; 57 } 58 fileAttributes = readInt2( buffer, bufferIndex ); 59 bufferIndex += 2; 60 lastWriteTime = readUTime( buffer, bufferIndex ); 61 bufferIndex += 4; 62 fileSize = readInt4( buffer, bufferIndex ); 63 return 20; 64 } 65 int readBytesWireFormat( byte[] buffer, int bufferIndex ) { 66 return 0; 67 } 68 public String toString() { 69 return new String ( "SmbComQueryInformationResponse[" + 70 super.toString() + 71 ",fileAttributes=0x" + Hexdump.toHexString( fileAttributes, 4 ) + 72 ",lastWriteTime=" + new Date ( lastWriteTime ) + 73 ",fileSize=" + fileSize + "]" ); 74 } 75 } 76 77 | Popular Tags |