Package com.trilead.ssh2.packets

Examples of com.trilead.ssh2.packets.TypesReader.readString()


    int errorCode = tr.readUINT32();

    if (errorCode == ErrorCodes.SSH_FX_OK)
      return;

    throw new SFTPException(tr.readString(), errorCode);
  }

  /**
   *  Modify the attributes of a file. Used for operations such as changing
   *  the ownership, permissions or access times, as well as for truncating a file.
View Full Code Here


      int count = tr.readUINT32();

      if (count != 1)
        throw new IOException("The server sent an invalid SSH_FXP_NAME packet.");

      return tr.readString(charsetName);
    }

    if (t != Packet.SSH_FXP_STATUS)
      throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
View Full Code Here

    if (t != Packet.SSH_FXP_STATUS)
      throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");

    int errorCode = tr.readUINT32();

    throw new SFTPException(tr.readString(), errorCode);
  }

  private final Vector scanDirectory(byte[] handle) throws IOException
  {
    Vector files = new Vector();
View Full Code Here

        while (count > 0)
        {
          SFTPv3DirectoryEntry dirEnt = new SFTPv3DirectoryEntry();

          dirEnt.filename = tr.readString(charsetName);
          dirEnt.longEntry = tr.readString(charsetName);

          dirEnt.attributes = readAttrs(tr);
          files.addElement(dirEnt);
View Full Code Here

        while (count > 0)
        {
          SFTPv3DirectoryEntry dirEnt = new SFTPv3DirectoryEntry();

          dirEnt.filename = tr.readString(charsetName);
          dirEnt.longEntry = tr.readString(charsetName);

          dirEnt.attributes = readAttrs(tr);
          files.addElement(dirEnt);

          if (debug != null)
View Full Code Here

      int errorCode = tr.readUINT32();

      if (errorCode == ErrorCodes.SSH_FX_EOF)
        return files;

      throw new SFTPException(tr.readString(), errorCode);
    }
  }

  private final byte[] openDirectory(String path) throws IOException
  {
View Full Code Here

    if (t != Packet.SSH_FXP_STATUS)
      throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");

    int errorCode = tr.readUINT32();
    String errorMessage = tr.readString();

    throw new SFTPException(errorMessage, errorCode);
  }

  private final String expandString(byte[] b, int off, int len)
View Full Code Here

    /* Read and save extensions (if any) for later use */

    while (tr.remain() != 0)
    {
      String name = tr.readString();
      byte[] value = tr.readByteString();
      server_extensions.put(name, value);

      if (debug != null)
        debug.println("SSH_FXP_VERSION: extension: " + name + " = '" + expandString(value, 0, value.length)
View Full Code Here

    if (t != Packet.SSH_FXP_STATUS)
      throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");

    int errorCode = tr.readUINT32();
    String errorMessage = tr.readString();

    throw new SFTPException(errorMessage, errorCode);
  }

  /**
 
View Full Code Here

      }

      return -1;
    }

    String errorMessage = tr.readString();

    throw new SFTPException(errorMessage, errorCode);
  }

  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.