Android File Delete deleteFolders(File dir)

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

Description

delete Folders

Declaration

public static void deleteFolders(File dir) 

Method Source Code

//package com.java2s;

import java.io.File;

public class Main {
    public static void deleteFolders(File dir) {
        if (dir.isDirectory()) {
            File[] children = dir.listFiles();
            for (File child : children) {
                deleteFolders(child);/*from w w w.ja  va  2s .  c o  m*/
            }
            dir.delete();
        }
    }
}

Related

  1. deleteFileOnly(String path)
  2. deleteFiles(File file)
  3. deleteFiles(File file, String regex)
  4. deleteFilesRecursive(File src)
  5. deleteFolder(File targetFolder)
  6. deleteIfExists(File file)
  7. deleteOldFile(String strPath, String strWildcard, int iOffset)
  8. deleteRecursively(File dir)
  9. deleteRecursively(File f)