I have a jsp page, which send a request for bunch of files to download. I am using spring from the controller I am sending request to a service layer class where I am collecting all the directories /sub-directories and files for download and placing them into a new directory which is placed out side the WEB-INF. But my method is unable to delete those files.
I have tried this code in a sample test class and I was able to delete all the directories. Kindly let me know what can be the issue?
What error you get ?
Couple of things to note
1) Your application should have permission to delete the files and directories.
2) The directory must be empty in order to be deleted. So check for isFile() delete all the files first recursively and then go for directories.