I am currently trying to recursively delete a directory... Strangely enough the shortest piece of code I was able to find is the following construct, employing an ad-hoc
If you already have Spring Core as part of your project, here is an easy way to do it:
FileSystemUtils.deleteRecursively(dir);
Source:http://www.baeldung.com/java-delete-directory