KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jcifs > smb > SmbComNTCreateAndXResponse


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 jcifs.smb;
20
21 import java.util.Date JavaDoc;
22 import jcifs.util.Hexdump;
23
24 class SmbComNTCreateAndXResponse extends AndXServerMessageBlock {
25
26     static final int EXCLUSIVE_OPLOCK_GRANTED = 1;
27     static final int BATCH_OPLOCK_GRANTED = 2;
28     static final int LEVEL_II_OPLOCK_GRANTED = 3;
29
30     byte oplockLevel;
31     int fid,
32         createAction,
33         extFileAttributes,
34         fileType,
35         deviceState;
36     long creationTime,
37         lastAccessTime,
38         lastWriteTime,
39         changeTime,
40         allocationSize,
41         endOfFile;
42     boolean directory;
43 boolean isExtended;
44
45     SmbComNTCreateAndXResponse() {
46     }
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         int start = bufferIndex;
56
57         oplockLevel = buffer[bufferIndex++];
58         fid = readInt2( buffer, bufferIndex );
59         bufferIndex += 2;
60         createAction = readInt4( buffer, bufferIndex );
61         bufferIndex += 4;
62         creationTime = readTime( buffer, bufferIndex );
63         bufferIndex += 8;
64         lastAccessTime = readTime( buffer, bufferIndex );
65         bufferIndex += 8;
66         lastWriteTime = readTime( buffer, bufferIndex );
67         bufferIndex += 8;
68         changeTime = readTime( buffer, bufferIndex );
69         bufferIndex += 8;
70         extFileAttributes = readInt4( buffer, bufferIndex );
71         bufferIndex += 4;
72         allocationSize = readInt8( buffer, bufferIndex );
73         bufferIndex += 8;
74         endOfFile = readInt8( buffer, bufferIndex );
75         bufferIndex += 8;
76         fileType = readInt2( buffer, bufferIndex );
77         bufferIndex += 2;
78         deviceState = readInt2( buffer, bufferIndex );
79         bufferIndex += 2;
80         directory = ( buffer[bufferIndex++] & 0xFF ) > 0;
81
82         return bufferIndex - start;
83     }
84     int readBytesWireFormat( byte[] buffer, int bufferIndex ) {
85         return 0;
86     }
87     public String JavaDoc toString() {
88         return new String JavaDoc( "SmbComNTCreateAndXResponse[" +
89             super.toString() +
90             ",oplockLevel=" + oplockLevel +
91             ",fid=" + fid +
92             ",createAction=0x" + Hexdump.toHexString( createAction, 4 ) +
93             ",creationTime=" + new Date JavaDoc( creationTime ) +
94             ",lastAccessTime=" + new Date JavaDoc( lastAccessTime ) +
95             ",lastWriteTime=" + new Date JavaDoc( lastWriteTime ) +
96             ",changeTime=" + new Date JavaDoc( changeTime ) +
97             ",extFileAttributes=0x" + Hexdump.toHexString( extFileAttributes, 4 ) +
98             ",allocationSize=" + allocationSize +
99             ",endOfFile=" + endOfFile +
100             ",fileType=" + fileType +
101             ",deviceState=" + deviceState +
102             ",directory=" + directory + "]" );
103     }
104 }
105
Popular Tags