Class DefaultSftpClient

    • Method Detail

      • getVersion

        public int getVersion()
        Returns:
        The negotiated SFTP protocol version
      • getServerExtensions

        public NavigableMap<String,​byte[]> getServerExtensions()
        Returns:
        An (unmodifiable) NavigableMap of the reported server extensions. where key=extension name (case insensitive)
      • setNameDecodingCharset

        public void setNameDecodingCharset​(Charset nameDecodingCharset)
      • isClosing

        public boolean isClosing()
      • isOpen

        public boolean isOpen()
      • data

        protected int data​(byte[] buf,
                           int start,
                           int len)
                    throws IOException
        Receive binary data
        Parameters:
        buf - The buffer for the incoming data
        start - Offset in buffer to place the data
        len - Available space in buffer for the data
        Returns:
        Actual size of received data
        Throws:
        IOException - If failed to receive incoming data
      • receive

        protected boolean receive​(Buffer incoming)
                           throws IOException
        Read SFTP packets from buffer
        Parameters:
        incoming - The received Buffer
        Returns:
        true if data from incoming buffer was processed
        Throws:
        IOException - if failed to process the buffer
        See Also:
        process(Buffer)
      • process

        protected void process​(Buffer incoming)
                        throws IOException
        Process an SFTP packet
        Parameters:
        incoming - The received Buffer
        Throws:
        IOException - if failed to process the buffer
      • send

        public int send​(int cmd,
                        Buffer buffer)
                 throws IOException
        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 Buffer receive​(int id)
                       throws IOException
        Parameters:
        id - The expected request id
        Returns:
        The received response Buffer containing the request id
        Throws:
        IOException - If connection closed or interrupted