Here you can find the source of deleteRecursively(File fileEntry)
Parameter | Description |
---|---|
fileEntry | is the entry to begin with |
private static void deleteRecursively(File fileEntry)
//package com.java2s; //License from project: LGPL import java.io.File; public class Main { /**/*from w ww. ja v a 2s . c o m*/ * Recursively deletes a directory or a file immediately. * * @param fileEntry * is the entry to begin with */ private static void deleteRecursively(File fileEntry) { if (fileEntry.isDirectory()) { File[] listFiles = fileEntry.listFiles(); for (File file : listFiles) { deleteRecursively(file); } } if (!fileEntry.delete()) { fileEntry.deleteOnExit(); } } }