Package ch.ethz.ssh2.channel

Examples of ch.ethz.ssh2.channel.ChannelManager


    sendMessage(Packet.SSH_FXP_READ, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    TypesReader tr = new TypesReader(resp);

    int t = tr.readByte();

    int rep_id = tr.readUINT32();
    if (rep_id != req_id)
      throw new IOException("The server sent an invalid id field.");

    if (t == Packet.SSH_FXP_DATA)
    {
      if (debug != null)
      {
        debug.println("Got SSH_FXP_DATA...");
        debug.flush();
      }

      int readLen = tr.readUINT32();

      if ((readLen < 0) || (readLen > len))
        throw new IOException("The server sent an invalid length field.");

      tr.readBytes(dst, dstoff, readLen);

      return readLen;
    }

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

    int errorCode = tr.readUINT32();

    if (errorCode == ErrorCodes.SSH_FX_EOF)
    {
      if (debug != null)
      {
        debug.println("Got SSH_FX_EOF.");
        debug.flush();
      }

      return -1;
    }

    String errorMessage = tr.readString();

    throw new SFTPException(errorMessage, errorCode);
  }
View Full Code Here


        srcoff += writeRequestLen;
        len -= writeRequestLen;

        byte[] resp = receiveMessage(34000);

        TypesReader tr = new TypesReader(resp);

        int t = tr.readByte();

        int rep_id = tr.readUINT32();
        if (rep_id != req_id)
          throw new IOException("The server sent an invalid id field.");

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

        int errorCode = tr.readUINT32();

        if (errorCode == ErrorCodes.SSH_FX_OK)
          continue;

        String errorMessage = tr.readString();

        throw new SFTPException(errorMessage, errorCode);
      }
  }
View Full Code Here

  private final void closeHandle(byte[] handle) throws IOException
  {
    int req_id = generateNextRequestID();

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

    sendMessage(Packet.SSH_FXP_CLOSE, 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);

    if (debug != null)
    {
      debug.println("Sending SSH_FXP_FSTAT...");
      debug.flush();
    }

    sendMessage(Packet.SSH_FXP_FSTAT, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    if (debug != null)
    {
View Full Code Here

    if (am == null)
      am = new AuthenticationManager(tm);

    if (cm == null)
      cm = new ChannelManager(tm);

    if (user == null)
      throw new IllegalArgumentException("user argument is null");

    if (pem == null)
View Full Code Here

    if (am == null)
      am = new AuthenticationManager(tm);

    if (cm == null)
      cm = new ChannelManager(tm);

    if (user == null)
      throw new IllegalArgumentException("user argument is null");

    authenticated = am.authenticateInteractive(user, submethods, cb);
View Full Code Here

    if (am == null)
      am = new AuthenticationManager(tm);

    if (cm == null)
      cm = new ChannelManager(tm);

    if (user == null)
      throw new IllegalArgumentException("user argument is null");

    if (password == null)
View Full Code Here

    if (am == null)
      am = new AuthenticationManager(tm);

    if (cm == null)
      cm = new ChannelManager(tm);

    if (user == null)
      throw new IllegalArgumentException("user argument is null");

    /* Trigger the sending of the PacketUserauthRequestNone packet */
 
View Full Code Here

    if (am == null)
      am = new AuthenticationManager(tm);

    if (cm == null)
      cm = new ChannelManager(tm);

    if (user == null)
      throw new IllegalArgumentException("user argument is null");

    if (pemPrivateKey == null)
View Full Code Here

    if (am == null)
      am = new AuthenticationManager(tm);

    if (cm == null)
      cm = new ChannelManager(tm);

    return am.getRemainingMethods(user);
  }
View Full Code Here

TOP

Related Classes of ch.ethz.ssh2.channel.ChannelManager

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.