Here you can find the source of deleteDirectory(File path)
Parameter | Description |
---|---|
path | a parameter |
public static boolean deleteDirectory(File path)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**// w w w . j a v a2 s.c om * Force deletion of directory * * @param path * @return */ public static boolean deleteDirectory(File path) { if (path.exists()) { File[] files = path.listFiles(); for (File file : files) { if (file.isDirectory()) { deleteDirectory(file); } else { file.delete(); } } } return (path.delete()); } }