001: /* jcifs smb client library in Java
002: * Copyright (C) 2000 "Michael B. Allen" <jcifs at samba dot org>
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or (at your option) any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: */
018:
019: package jcifs.smb;
020:
021: import java.util.Date;
022: import java.io.IOException;
023: import java.io.InputStream;
024: import jcifs.util.Hexdump;
025:
026: class SmbComNTCreateAndXResponse extends AndXServerMessageBlock {
027:
028: static final int EXCLUSIVE_OPLOCK_GRANTED = 1;
029: static final int BATCH_OPLOCK_GRANTED = 2;
030: static final int LEVEL_II_OPLOCK_GRANTED = 3;
031:
032: byte oplockLevel;
033: int fid, createAction, extFileAttributes, fileType, deviceState;
034: long creationTime, lastAccessTime, lastWriteTime, changeTime,
035: allocationSize, endOfFile;
036: boolean directory;
037:
038: SmbComNTCreateAndXResponse() {
039: }
040:
041: int writeParameterWordsWireFormat(byte[] dst, int dstIndex) {
042: return 0;
043: }
044:
045: int writeBytesWireFormat(byte[] dst, int dstIndex) {
046: return 0;
047: }
048:
049: int readParameterWordsWireFormat(byte[] buffer, int bufferIndex) {
050: int start = bufferIndex;
051:
052: oplockLevel = buffer[bufferIndex++];
053: fid = readInt2(buffer, bufferIndex);
054: bufferIndex += 2;
055: createAction = readInt4(buffer, bufferIndex);
056: bufferIndex += 4;
057: creationTime = readTime(buffer, bufferIndex);
058: bufferIndex += 8;
059: lastAccessTime = readTime(buffer, bufferIndex);
060: bufferIndex += 8;
061: lastWriteTime = readTime(buffer, bufferIndex);
062: bufferIndex += 8;
063: changeTime = readTime(buffer, bufferIndex);
064: bufferIndex += 8;
065: extFileAttributes = readInt4(buffer, bufferIndex);
066: bufferIndex += 4;
067: allocationSize = readInt8(buffer, bufferIndex);
068: bufferIndex += 8;
069: endOfFile = readInt8(buffer, bufferIndex);
070: bufferIndex += 8;
071: fileType = readInt2(buffer, bufferIndex);
072: bufferIndex += 2;
073: deviceState = readInt2(buffer, bufferIndex);
074: bufferIndex += 2;
075: directory = (buffer[bufferIndex++] & 0xFF) > 0;
076:
077: return bufferIndex - start;
078: }
079:
080: int readBytesWireFormat(byte[] buffer, int bufferIndex) {
081: return 0;
082: }
083:
084: int readBytesDirectWireFormat(InputStream in, int byteCount,
085: byte[] buffer, int bufferIndex) throws IOException {
086: return 0;
087: }
088:
089: public String toString() {
090: return new String("SmbComNTCreateAndXResponse["
091: + super .toString() + ",oplockLevel=" + oplockLevel
092: + ",fid=" + fid + ",createAction=0x"
093: + Hexdump.toHexString(createAction, 4)
094: + ",creationTime=" + new Date(creationTime)
095: + ",lastAccessTime=" + new Date(lastAccessTime)
096: + ",lastWriteTime=" + new Date(lastWriteTime)
097: + ",changeTime=" + new Date(changeTime)
098: + ",extFileAttributes=0x"
099: + Hexdump.toHexString(extFileAttributes, 4)
100: + ",allocationSize=" + allocationSize + ",endOfFile="
101: + endOfFile + ",fileType=" + fileType + ",deviceState="
102: + deviceState + ",directory=" + directory + "]");
103: }
104: }
|