Here you can find the source of deleteTree(final File file)
Parameter | Description |
---|---|
file | the directory to be deep deleted |
public static void deleteTree(final File file)
//package com.java2s; import java.io.File; public class Main { /**//from w w w .java2 s . co m * This method can be used to perform a deep deletion of a directory structure starting at, and including the * directory provided. * * @param file * the directory to be deep deleted */ public static void deleteTree(final File file) { if (file != null) { if (file.isDirectory()) { String[] children = file.list(); for (String child : children) { File childFile = new File(file, child); deleteTree(childFile); } } file.delete(); } } }