1 18 19 package jcifs.smb; 20 21 import java.io.UnsupportedEncodingException ; 22 23 class SmbComTreeConnectAndXResponse extends AndXServerMessageBlock { 24 25 private static final int SMB_SUPPORT_SEARCH_BITS = 0x0001; 26 private static final int SMB_SHARE_IS_IN_DFS = 0x0002; 27 28 boolean supportSearchBits, shareIsInDfs; 29 String service, nativeFileSystem = ""; 30 31 SmbComTreeConnectAndXResponse( ServerMessageBlock andx ) { 32 super( andx ); 33 } 34 35 int writeParameterWordsWireFormat( byte[] dst, int dstIndex ) { 36 return 0; 37 } 38 int writeBytesWireFormat( byte[] dst, int dstIndex ) { 39 return 0; 40 } 41 int readParameterWordsWireFormat( byte[] buffer, int bufferIndex ) { 42 supportSearchBits = ( buffer[bufferIndex] & SMB_SUPPORT_SEARCH_BITS ) == SMB_SUPPORT_SEARCH_BITS; 43 shareIsInDfs = ( buffer[bufferIndex] & SMB_SHARE_IS_IN_DFS ) == SMB_SHARE_IS_IN_DFS; 44 return 2; 45 } 46 int readBytesWireFormat( byte[] buffer, int bufferIndex ) { 47 int start = bufferIndex; 48 49 int len = readStringLength( buffer, bufferIndex, 32 ); 50 try { 51 service = new String ( buffer, bufferIndex, len, "ASCII" ); 52 } catch( UnsupportedEncodingException uee ) { 53 return 0; 54 } 55 bufferIndex += len + 1; 56 if( byteCount > bufferIndex - start ) { 58 nativeFileSystem = readString( buffer, bufferIndex ); 59 bufferIndex += stringWireLength( nativeFileSystem, bufferIndex ); 60 } 61 62 return bufferIndex - start; 63 } 64 public String toString() { 65 String result = new String ( "SmbComTreeConnectAndXResponse[" + 66 super.toString() + 67 ",supportSearchBits=" + supportSearchBits + 68 ",shareIsInDfs=" + shareIsInDfs + 69 ",service=" + service + 70 ",nativeFileSystem=" + nativeFileSystem + "]" ); 71 return result; 72 } 73 } 74 75 | Popular Tags |