Android Utililty Methods Folder Recursive Delete

List of utility methods to do Folder Recursive Delete

Description

The list of methods to do Folder Recursive Delete are organized into topic(s).

Method

booleanrmr(File path)
rm -r equivalent -- remove file/dir recursively.
Preconditions.checkArgument(!path.getCanonicalPath().equals("/"));
if (path.exists() && path.isDirectory()) {
    File[] files = path.listFiles();
    for (int i = 0; i < files.length; i++) {
        rmr(files[i]);
return path.delete();
...
voiddeleteFileAndFolder(File fileOrFolder)
delete File And Folder
if (fileOrFolder == null || !fileOrFolder.exists()) {
    return;
if (fileOrFolder.isDirectory()) {
    File[] children = fileOrFolder.listFiles();
    if (children != null) {
        for (File childFile : children) {
            deleteFileAndFolder(childFile);
...