Package ch.ethz.ssh2.packets

Examples of ch.ethz.ssh2.packets.TypesWriter


  {
    checkHandleValidAndOpen(handle);

    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(handle.fileHandle, 0, handle.fileHandle.length);

    log.debug("Sending SSH_FXP_FSTAT...");
    sendMessage(Packet.SSH_FXP_FSTAT, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    TypesReader tr = new TypesReader(resp);
View Full Code Here


  private SFTPv3FileAttributes statBoth(String path, int statMethod) throws IOException
  {
    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(path, charsetName);

    log.debug("Sending SSH_FXP_STAT/SSH_FXP_LSTAT...");
    sendMessage(statMethod, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    TypesReader tr = new TypesReader(resp);
View Full Code Here

   */
  public String readLink(String path) throws IOException
  {
    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(path, charsetName);

    log.debug("Sending SSH_FXP_READLINK...");
    sendMessage(Packet.SSH_FXP_READLINK, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    TypesReader tr = new TypesReader(resp);

View Full Code Here

   */
  public void setstat(String path, SFTPv3FileAttributes attr) throws IOException
  {
    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(path, charsetName);
    tw.writeBytes(createAttrs(attr));

    log.debug("Sending SSH_FXP_SETSTAT...");
    sendMessage(Packet.SSH_FXP_SETSTAT, req_id, tw.getBytes());

    expectStatusOKMessage(req_id);
  }
View Full Code Here

  {
    checkHandleValidAndOpen(handle);

    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(handle.fileHandle, 0, handle.fileHandle.length);
    tw.writeBytes(createAttrs(attr));

    log.debug("Sending SSH_FXP_FSETSTAT...");
    sendMessage(Packet.SSH_FXP_FSETSTAT, req_id, tw.getBytes());

    expectStatusOKMessage(req_id);
  }
View Full Code Here

    /* Either I am too stupid to understand the SFTP draft
           * or the OpenSSH guys changed the semantics of src and target.
           */

    TypesWriter tw = new TypesWriter();
    tw.writeString(target, charsetName);
    tw.writeString(src, charsetName);

    log.debug("Sending SSH_FXP_SYMLINK...");
    sendMessage(Packet.SSH_FXP_SYMLINK, req_id, tw.getBytes());

    expectStatusOKMessage(req_id);
  }
View Full Code Here

   */
  public String canonicalPath(String path) throws IOException
  {
    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(path, charsetName);

    log.debug("Sending SSH_FXP_REALPATH...");
    sendMessage(Packet.SSH_FXP_REALPATH, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    TypesReader tr = new TypesReader(resp);

View Full Code Here

    while (true)
    {
      int req_id = generateNextRequestID();

      TypesWriter tw = new TypesWriter();
      tw.writeString(handle, 0, handle.length);

      log.debug("Sending SSH_FXP_READDIR...");
      sendMessage(Packet.SSH_FXP_READDIR, req_id, tw.getBytes());

      byte[] resp = receiveMessage(34000);

      TypesReader tr = new TypesReader(resp);
View Full Code Here

  public final SFTPv3FileHandle openDirectory(String path) throws IOException
  {
    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(path, charsetName);

    log.debug("Sending SSH_FXP_OPENDIR...");
    sendMessage(Packet.SSH_FXP_OPENDIR, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    TypesReader tr = new TypesReader(resp);
View Full Code Here

    /* Send SSH_FXP_INIT (version 3) */

    final int client_version = 3;

    log.debug("Sending SSH_FXP_INIT (" + client_version + ")...");
    TypesWriter tw = new TypesWriter();
    tw.writeUINT32(client_version);
    sendMessage(Packet.SSH_FXP_INIT, 0, tw.getBytes());

    /* Receive SSH_FXP_VERSION */

    log.debug("Waiting for SSH_FXP_VERSION...");
    TypesReader tr = new TypesReader(receiveMessage(34000)); /* Should be enough for any reasonable server */
 
View Full Code Here

TOP

Related Classes of ch.ethz.ssh2.packets.TypesWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.