I have create some code that deletes all the files in a folder, the issue is while this is great, I want to be able to delete all the files in a directory but leave the fold
I think this will do
public void deleteFiles(File folder) throws IOException {
List files = folder.listFiles()
foreach(File file: files){
if(file.isFile()){
file.delete();
}else if(file.isDirecotry()) {
deleteFiles(file)
}
}
}
Then you need to call deleteFiles(new File("D:/Documents/NetBeansProjects/printing~subversion/fileupload/web/resources/pdf/"))
;