Android File Delete deleteDir(File dir)

Here you can find the source of deleteDir(File dir)

Description

delete Dir

Declaration

public static boolean deleteDir(File dir) 

Method Source Code

//package com.java2s;

import java.io.File;

public class Main {
    public static boolean deleteDir(File dir) {
        if (dir.isDirectory()) {
            File[] children = dir.listFiles();
            for (File child : children) {
                boolean success = deleteDir(child);
                if (!success) {
                    return false;
                }//w  ww .  j  av a 2  s.  c o  m
            }
        }

        // The directory is now empty so delete it
        return dir.delete();
    }
}

Related

  1. deleteAll(File file)
  2. deleteAndRename(File toDelete, File toRename)
  3. deleteApkInSystem(String fileName, int type)
  4. deleteDatabaseFile(int type, Context context)
  5. deleteDir(File dir)
  6. deleteDir(File spec)
  7. deleteDirContent(File d)
  8. deleteFile(File f)
  9. deleteFile(File f)