Java based access to the Ex Libris Secure FTP Service
In a previous blog post, we have seen how to access the SFTP Service using FTP clients and the command line.
Here we show a short Java program that connects using the private key, and deletes files older than X number of days.
The SFTP service is configured to delete files older than 30 days automatically, but say you want that to be 20 days, you can schedule this to run daily.
The program can be altered to keep a backup copy of specific files or directories (before they are deleted automatically according to the 30 days policy).
See the code in this GitHub gist.