001: /*
002: * SSHTools - Java SSH2 API
003: *
004: * Copyright (C) 2002-2003 Lee David Painter and Contributors.
005: *
006: * Contributions made by:
007: *
008: * Brett Smith
009: * Richard Pernavas
010: * Erwin Bolwidt
011: *
012: * This program is free software; you can redistribute it and/or
013: * modify it under the terms of the GNU General Public License
014: * as published by the Free Software Foundation; either version 2
015: * of the License, or (at your option) any later version.
016: *
017: * This program is distributed in the hope that it will be useful,
018: * but WITHOUT ANY WARRANTY; without even the implied warranty of
019: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
020: * GNU General Public License for more details.
021: *
022: * You should have received a copy of the GNU General Public License
023: * along with this program; if not, write to the Free Software
024: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
025: */
026: package com.sshtools.j2ssh.sftp;
027:
028: import com.sshtools.j2ssh.io.ByteArrayReader;
029: import com.sshtools.j2ssh.io.ByteArrayWriter;
030: import com.sshtools.j2ssh.io.UnsignedInteger32;
031: import com.sshtools.j2ssh.subsystem.SubsystemMessage;
032:
033: /**
034: *
035: *
036: * @author $author$
037: * @version $Revision: 1.15 $
038: */
039: public class SshFxpLStat extends SubsystemMessage implements
040: MessageRequestId {
041: /** */
042: public static final int SSH_FXP_LSTAT = 7;
043: private UnsignedInteger32 id;
044: private String path;
045:
046: /**
047: * Creates a new SshFxpLStat object.
048: */
049: public SshFxpLStat() {
050: super (SSH_FXP_LSTAT);
051: }
052:
053: /**
054: * Creates a new SshFxpLStat object.
055: *
056: * @param id
057: * @param path
058: */
059: public SshFxpLStat(UnsignedInteger32 id, String path) {
060: super (SSH_FXP_LSTAT);
061: this .id = id;
062: this .path = path;
063: }
064:
065: /**
066: *
067: *
068: * @param bar
069: *
070: * @throws java.io.IOException
071: * @throws com.sshtools.j2ssh.transport.InvalidMessageException DOCUMENT
072: * ME!
073: */
074: public void constructMessage(ByteArrayReader bar)
075: throws java.io.IOException,
076: com.sshtools.j2ssh.transport.InvalidMessageException {
077: id = bar.readUINT32();
078: path = bar.readString();
079: }
080:
081: /**
082: *
083: *
084: * @return
085: */
086: public String getMessageName() {
087: return "SSH_FXP_LSTAT";
088: }
089:
090: /**
091: *
092: *
093: * @return
094: */
095: public UnsignedInteger32 getId() {
096: return id;
097: }
098:
099: /**
100: *
101: *
102: * @return
103: */
104: public String getPath() {
105: return path;
106: }
107:
108: /**
109: *
110: *
111: * @param baw
112: *
113: * @throws java.io.IOException
114: * @throws com.sshtools.j2ssh.transport.InvalidMessageException DOCUMENT
115: * ME!
116: */
117: public void constructByteArray(ByteArrayWriter baw)
118: throws java.io.IOException,
119: com.sshtools.j2ssh.transport.InvalidMessageException {
120: baw.writeUINT32(id);
121: baw.writeString(path);
122: }
123: }
|