Android Directory Delete removerDiretorio(File dir)

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

Description

remover Diretorio

Declaration

public static boolean removerDiretorio(File dir) 

Method Source Code

//package com.java2s;
import java.io.File;

public class Main {
    public static boolean removerDiretorio(File dir) {
        if (dir.isDirectory()) {
            String[] children = dir.list();
            for (int i = 0; i < children.length; i++) {
                boolean success = removerDiretorio(new File(dir,
                        children[i]));/*from w  w w.  ja  v  a  2s.c o m*/
                if (!success) {
                    return false;
                }
            }
        }

        return dir.delete();
    }
}

Related

  1. deleteDirectory(final File directory)
  2. deleteFiles(String directory)
  3. deleteFiles(String directory, String dontDelete)
  4. deleteFiles(String directory, String[] dontDelete)
  5. deleteSubdirs(String directory)
  6. deleteDirectory(File path)
  7. deleteDir(File dir)
  8. deleteDir(File f)