I need a pure Apache Commons VFS solution/code/example for
- Uploading a local file to Remote Host Location
- Check if a File exists in Remote Host Location
- Downloading a Remote Host File to Local file location
- Move a file from one Remote Location to another in the same Host
- Delete a file from the Remote Host Location
via SFTP calls.
The solution should only use Apache Commons VFS api and shouldn't refer to the underlying JSCH library.
The below SFTP Utility gives an example of Upload, Exist, Download, Move and Delete operations. I have used this in several of my projects. The below code uses api calls from Apache Commons VFS library only.
Please make sure that you put the following JAR's in your project's build path:
Any other compatible versions would do as well.