Here you can find the source of recursiveDelete(final File pFile)
Parameter | Description |
---|---|
pFile | which should be deleted included descendants |
public static boolean recursiveDelete(final File pFile)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**//from www . j a v a 2 s .c o m * Deleting a storage recursive. Used for deleting a databases * * @param pFile * which should be deleted included descendants * @return true if delete is valid */ public static boolean recursiveDelete(final File pFile) { if (pFile.isDirectory()) { for (final File child : pFile.listFiles()) { if (!recursiveDelete(child)) { return false; } } } return pFile.delete(); } }