Class AbstractSftpClientExtension

    • Method Detail

      • sendAndCheckExtendedCommandStatus

        protected void sendAndCheckExtendedCommandStatus​(org.apache.sshd.common.util.buffer.Buffer buffer)
                                                  throws IOException
        Throws:
        IOException
      • sendExtendedCommand

        protected int sendExtendedCommand​(org.apache.sshd.common.util.buffer.Buffer buffer)
                                   throws IOException
        Throws:
        IOException
      • send

        public int send​(int cmd,
                        org.apache.sshd.common.util.buffer.Buffer buffer)
                 throws IOException
        Specified by:
        send in interface RawSftpClient
        Parameters:
        cmd - Command to send - Note: only lower 8-bits are used
        buffer - The Buffer containing the command data
        Returns:
        The assigned request id
        Throws:
        IOException - if failed to send command
      • receive

        public org.apache.sshd.common.util.buffer.Buffer receive​(int id)
                                                          throws IOException
        Specified by:
        receive in interface RawSftpClient
        Parameters:
        id - The expected request id
        Returns:
        The received response Buffer containing the request id
        Throws:
        IOException - If connection closed or interrupted
      • receive

        public org.apache.sshd.common.util.buffer.Buffer receive​(int id,
                                                                 long timeout)
                                                          throws IOException
        Specified by:
        receive in interface RawSftpClient
        Parameters:
        id - The expected request id
        timeout - The amount of time to wait for the response
        Returns:
        The received response Buffer containing the request id
        Throws:
        IOException - If connection closed or interrupted
      • receive

        public org.apache.sshd.common.util.buffer.Buffer receive​(int id,
                                                                 Duration timeout)
                                                          throws IOException
        Specified by:
        receive in interface RawSftpClient
        Parameters:
        id - The expected request id
        timeout - The amount of time to wait for the response
        Returns:
        The received response Buffer containing the request id
        Throws:
        IOException - If connection closed or interrupted
      • checkStatus

        protected void checkStatus​(org.apache.sshd.common.util.buffer.Buffer buffer)
                            throws IOException
        Throws:
        IOException
      • putTarget

        public org.apache.sshd.common.util.buffer.Buffer putTarget​(org.apache.sshd.common.util.buffer.Buffer buffer,
                                                                   Object target)
        Parameters:
        buffer - The Buffer
        target - A target path String or SftpClient.Handle or byte[] to be encoded in the buffer
        Returns:
        The updated buffer
        Throws:
        UnsupportedOperationException - If target is not one of the above supported types
      • getCommandBuffer

        protected org.apache.sshd.common.util.buffer.Buffer getCommandBuffer​(Object target)
        Parameters:
        target - A target path String or SftpClient.Handle or byte[] to be encoded in the buffer
        Returns:
        A Buffer with the extension name set
        See Also:
        getCommandBuffer(Object, int)
      • getCommandBuffer

        protected org.apache.sshd.common.util.buffer.Buffer getCommandBuffer​(Object target,
                                                                             int extraSize)
        Parameters:
        target - A target path String or SftpClient.Handle or byte[] to be encoded in the buffer
        extraSize - Extra size - beyond the path/handle to be allocated
        Returns:
        A Buffer with the extension name set
        See Also:
        getCommandBuffer(int)
      • getCommandBuffer

        protected org.apache.sshd.common.util.buffer.Buffer getCommandBuffer​(int extraSize)
        Parameters:
        extraSize - Extra size - besides the extension name
        Returns:
        A Buffer with the extension name set