Android File Delete deleteFile(File root)

Here you can find the source of deleteFile(File root)

Description

delete File

Declaration

public static boolean deleteFile(File root) 

Method Source Code

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

public class Main {
    public static boolean deleteFile(File root) {
        if (root.exists()) {
            if (root.isDirectory()) {
                File[] files = root.listFiles();
                for (int i = 0; i < files.length; i++)
                    deleteFile(files[i]);
            }//from  w w  w .  j  a va  2s  .  c o  m

            return root.delete();
        }
        return false;
    }
}

Related

  1. deleteFile(File file)
  2. deleteFile(File file)
  3. deleteFile(File file)
  4. deleteFile(File file)
  5. deleteFile(File file)
  6. deleteFile(File spec)
  7. deleteFile(String filePath)
  8. deleteFile(String filePath)
  9. deleteFile(String filename)