Here you can find the source of deleteDirectoryRecursively(File rootFile)
Parameter | Description |
---|---|
rootFile | a parameter |
public static void deleteDirectoryRecursively(File rootFile)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { /**/* w ww. j a v a 2s . c o m*/ * Recursive function to delete Directory having content. * @param rootFile */ public static void deleteDirectoryRecursively(File rootFile) { File[] files = rootFile.listFiles(); if (files != null) { for (File file : files) { if (file.isFile()) { file.delete(); } else if (file.isDirectory()) { deleteDirectoryRecursively(file); } } } rootFile.delete(); } }