Here you can find the source of deleteRecursive(File path)
Parameter | Description |
---|---|
path | The file path to include |
public static void deleteRecursive(File path)
//package com.java2s; import java.io.*; public class Main { /**// w w w . j a v a2 s .co m * Delete a directory and its contents recursively * * @param path The file path to include */ public static void deleteRecursive(File path) { File[] c = path.listFiles(); for (File file : c) { if (file.isDirectory()) { deleteRecursive(file); file.delete(); } else { file.delete(); } } path.delete(); } }