Class SftpMessage

java.lang.Object
org.apache.sshd.sftp.client.SftpMessage

public class SftpMessage extends Object
A representation of a written SFTP message.
  • Field Details

    • id

      private final int id
    • future

      private final IoWriteFuture future
    • timeout

      private final Duration timeout
  • Constructor Details

    • SftpMessage

      public SftpMessage(int id, IoWriteFuture future, Duration timeout)
      Creates a new instance.
      Parameters:
      id - SFTP message id
      future - IoWriteFuture of the SFTP message; can be used to wait until the message has been actually sent
      timeout - the configured SFTP write timeout
  • Method Details

    • getId

      public int getId()
      Retrieves the SFTP message id.
      Returns:
      the SFTP message id
    • getFuture

      public IoWriteFuture getFuture()
      Retrieves the IoWriteFuture of the message; can be used to wait until the message has been actually sent.
      Returns:
      the IoWriteFuture, never null
    • getTimeout

      public Duration getTimeout()
      Retrieves the write timeout configured when the message was sent.
      Returns:
      the timeout, never null
    • waitUntilSent

      public void waitUntilSent() throws IOException
      Waits with the configured timeout until the message has been sent.
      Throws:
      IOException - if the message could not be sent, or waiting is interrupted.