KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > knowgate > jcifs > smb > NetShareEnum


1 /* jcifs smb client library in Java
2  * Copyright (C) 2000 "Michael B. Allen" <jcifs at samba dot org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package com.knowgate.jcifs.smb;
20
21 import java.io.UnsupportedEncodingException JavaDoc;
22
23 class NetShareEnum extends SmbComTransaction {
24
25     private static final String JavaDoc DESCR = "WrLeh\u0000B13BWz\u0000";
26
27     NetShareEnum() {
28         command = SMB_COM_TRANSACTION;
29         subCommand = NET_SHARE_ENUM; // not really true be used by upper logic
30
name = new String JavaDoc( "\\PIPE\\LANMAN" );
31         maxParameterCount = 8;
32
33         maxDataCount = 4096;
34         maxSetupCount = (byte)0x00;
35         setupCount = 0;
36         timeout = 5000;
37     }
38
39     int writeSetupWireFormat( byte[] dst, int dstIndex ) {
40         return 0;
41     }
42     int writeParametersWireFormat( byte[] dst, int dstIndex ) {
43         int start = dstIndex;
44         byte[] descr;
45
46         try {
47             descr = DESCR.getBytes( "ASCII" );
48         } catch( UnsupportedEncodingException JavaDoc uee ) {
49             return 0;
50         }
51
52         writeInt2( NET_SHARE_ENUM, dst, dstIndex );
53         dstIndex += 2;
54         System.arraycopy( descr, 0, dst, dstIndex, descr.length );
55         dstIndex += descr.length;
56         writeInt2( 0x0001, dst, dstIndex );
57         dstIndex += 2;
58         writeInt2( maxDataCount, dst, dstIndex );
59         dstIndex += 2;
60
61         return dstIndex - start;
62     }
63     int writeDataWireFormat( byte[] dst, int dstIndex ) {
64         return 0;
65     }
66     int readSetupWireFormat( byte[] buffer, int bufferIndex, int len ) {
67         return 0;
68     }
69     int readParametersWireFormat( byte[] buffer, int bufferIndex, int len ) {
70         return 0;
71     }
72     int readDataWireFormat( byte[] buffer, int bufferIndex, int len ) {
73         return 0;
74     }
75     public String JavaDoc toString() {
76         return new String JavaDoc( "NetShareEnum[" + super.toString() + "]" );
77     }
78 }
79
Popular Tags