This question already has an answer here:
How to transfer a file through SFTP in java? I want sample code for SFTP client. I want to embed the SFTP server in my application and the client should able to send a file to my application.
PS: This was asked for SFTP client. And This question is not a duplicate of other two questions.
Try this code.