Recursively delete directory with JSch on SFTP with Java

For a recent project I needed a way to recursively delete a directory and all its content from a remote SFTP connection. This code snippet works like charm but be very careful when using it:

 

(163 Posts)

20 years of coding and working as software engineer but I am still eager to learn more. I am very passionate when it comes to open source, Linux and Java. But I made my peace with Windows long ago to fully enjoy my PC gaming hobby. I have a soft spot for 90s electronic music and Babylon 5.

Leave a Reply

Your email address will not be published. Required fields are marked *