Android File Delete deleteFile(File file)

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

Description

delete File

Declaration

public static boolean deleteFile(File file) 

Method Source Code

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

public class Main {

    public static boolean deleteFile(File file) {
        if (file != null && file.exists()) {
            if (file.isFile()) {
                return file.delete();
            } else {
                for (File f : file.listFiles()) {
                    deleteFile(f);/* w w  w  .  j a va 2 s  .  c o  m*/
                }
                return file.delete();
            }
        }
        return false;
    }
}

Related

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