...
Connect to the remote sftpremote.example.com system using the login "smokey" and password "bear".
Key Concepts
Access to a remote system using SFTP uses the SSH secure shell protocols. Although the behavior is similar to FTP, it is not FTP run over a secure connection. So there are some differences between FTP and SFTP that should be noted. One of these it the lack of the FTP binary/ASCII transfer mode, in SFTP all transfers are binary as if they were executed with an "scp" (secure copy) command.
This example code uses a regular expression to match files on the remote system, so that not all of the files in the source directory are transferred.
Source Code
pom.xml Project File
...