Here you can find the source of recursiveDelete(File file)
Parameter | Description |
---|---|
file | Folder to Delete |
public static void recursiveDelete(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**// w ww .ja v a 2 s.c om * Delete Folder with Sub-files * @param file Folder to Delete */ public static void recursiveDelete(File file) { if (!file.exists()) { return; } if (file.isDirectory()) { for (File f : file.listFiles()) { recursiveDelete(f); } } file.delete(); } }