Here you can find the source of deleteFilesRecursive(final File path)
Deletes files recursively.
Parameter | Description |
---|---|
path | the file or directory to delete. |
public static void deleteFilesRecursive(final File path)
//package com.java2s; import java.io.*; public class Main { /**/*w ww. j a v a 2 s . co m*/ * <p>Deletes files recursively.</p> * * @param path the file or directory to delete. */ public static void deleteFilesRecursive(final File path) { if (path.isDirectory()) { final File[] files = path.listFiles(); for (File file : files) deleteFilesRecursive(file); } path.delete(); } }