Here you can find the source of recursiveDelete(File dir)
Parameter | Description |
---|---|
dir | the dir |
private static void recursiveDelete(File dir)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**/*from w w w . j a v a2 s . c om*/ * Recursive delete. * * @param dir * the dir */ private static void recursiveDelete(File dir) { if (dir == null) return; if (dir.isFile()) { dir.delete(); return; } File[] entries = dir.listFiles(); if (entries == null) { return; } for (File entry : entries) { recursiveDelete(entry); } dir.delete(); } }