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