Saturday, November 11, 2017

Deleting all the files from folder in Java

package MyPackage;

import java.io.File;
import org.apache.commons.io.FileUtils;

public class DeleteAllFiles {

public static void main(String[] args) throws Exception {
// Delete all the files in the folder
File filepath = new File("C:\\Users\\Mutturaj.h\\Desktop\\TimeStamp");
FileUtils.cleanDirectory(filepath);

}

}

No comments:

Post a Comment