Here you can find the source of deleteAll(File path)
Parameter | Description |
---|---|
path | a parameter |
public static final void deleteAll(File path)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { /**/* w w w . ja va2 s .co m*/ * delete all files and folders under this path * * @param path */ public static final void deleteAll(File path) { if (path.isDirectory()) { for (File f : path.listFiles()) { deleteAll(f); } if (path.listFiles().length == 0) { path.delete(); } } else { path.delete(); } } public static final void deleteAll(String path) { deleteAll(new File(path)); } }