Lines Matching defs:Packet
24 import ch.ethz.ssh2.sftp.Packet;
32 * the packet types described in draft-ietf-secsh-filexfer-02.txt.
127 public void read(String packet)
129 log.debug("Read packet " + packet);
132 public void write(String packet)
134 log.debug("Write packet " + packet);
202 listener.write(Packet.forName(type));
206 if (type != Packet.SSH_FXP_INIT)
217 if (type != Packet.SSH_FXP_INIT)
273 throw new IOException("Illegal sftp packet len: " + len);
298 sendMessage(Packet.SSH_FXP_CLOSE, req_id, tw.getBytes());
386 sendMessage(Packet.SSH_FXP_FSTAT, req_id, tw.getBytes());
393 listener.read(Packet.forName(t));
401 if (t == Packet.SSH_FXP_ATTRS)
406 if (t != Packet.SSH_FXP_STATUS)
408 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
432 listener.read(Packet.forName(t));
440 if (t == Packet.SSH_FXP_ATTRS)
445 if (t != Packet.SSH_FXP_STATUS)
447 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
467 return statBoth(path, Packet.SSH_FXP_STAT);
481 return statBoth(path, Packet.SSH_FXP_LSTAT);
501 sendMessage(Packet.SSH_FXP_READLINK, req_id, tw.getBytes());
508 listener.read(Packet.forName(t));
516 if (t == Packet.SSH_FXP_NAME)
522 throw new IOException("The server sent an invalid SSH_FXP_NAME packet.");
528 if (t != Packet.SSH_FXP_STATUS)
530 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
546 listener.read(Packet.forName(t));
554 if (t != Packet.SSH_FXP_STATUS)
556 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
588 sendMessage(Packet.SSH_FXP_SETSTAT, req_id, tw.getBytes());
613 sendMessage(Packet.SSH_FXP_FSETSTAT, req_id, tw.getBytes());
639 sendMessage(Packet.SSH_FXP_SYMLINK, req_id, tw.getBytes());
661 sendMessage(Packet.SSH_FXP_REALPATH, req_id, tw.getBytes());
668 listener.read(Packet.forName(t));
676 if (t == Packet.SSH_FXP_NAME)
682 throw new IOException("The server sent an invalid SSH_FXP_NAME packet.");
690 if (t != Packet.SSH_FXP_STATUS)
692 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
713 sendMessage(Packet.SSH_FXP_READDIR, req_id, tw.getBytes());
720 listener.read(Packet.forName(t));
728 if (t == Packet.SSH_FXP_NAME)
750 if (t != Packet.SSH_FXP_STATUS)
752 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
775 sendMessage(Packet.SSH_FXP_OPENDIR, req_id, tw.getBytes());
782 listener.read(Packet.forName(t));
790 if (t == Packet.SSH_FXP_HANDLE)
796 if (t != Packet.SSH_FXP_STATUS)
798 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
837 sendMessage(Packet.SSH_FXP_INIT, 0, tw.getBytes());
845 listener.read(Packet.forName(t));
847 if (t != Packet.SSH_FXP_VERSION)
849 throw new IOException("The server did not send a SSH_FXP_VERSION packet (got " + t + ")");
934 sendMessage(Packet.SSH_FXP_MKDIR, req_id, tw.getBytes());
952 sendMessage(Packet.SSH_FXP_REMOVE, req_id, tw.getBytes());
970 sendMessage(Packet.SSH_FXP_RMDIR, req_id, tw.getBytes());
990 sendMessage(Packet.SSH_FXP_RENAME, req_id, tw.getBytes());
1221 sendMessage(Packet.SSH_FXP_OPEN, req_id, tw.getBytes());
1228 listener.read(Packet.forName(t));
1236 if (t == Packet.SSH_FXP_HANDLE)
1242 if (t != Packet.SSH_FXP_STATUS)
1244 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
1286 sendMessage(Packet.SSH_FXP_READ, id, tw.getBytes());
1392 listener.read(Packet.forName(t));
1401 if (t == Packet.SSH_FXP_STATUS)
1425 else if (t == Packet.SSH_FXP_DATA)
1432 throw new IOException("The server sent an invalid length field in a SSH_FXP_DATA packet.");
1446 /* Send this request packet again to request the remaing data in this slot. */
1460 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
1507 sendMessage(Packet.SSH_FXP_WRITE, req.req_id, tw.getBytes());
1524 listener.read(Packet.forName(t));
1534 if (t == Packet.SSH_FXP_STATUS)
1551 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
1560 listener.read(Packet.forName(t));
1570 if (t == Packet.SSH_FXP_STATUS)
1591 throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");