How to delete files of a directory but not the folders
问题 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 folders intact, so I do not have to go into each folder and delete the files in it, this is my current code : @ViewScoped @ManagedBean public class Delete { public void DeleteFiles() throws IOException { System.out.println("Called deleteFiles"); File file = new File("D:/Documents/NetBeansProjects/printing~subversion/fileupload