Android File Delete deleteFile(File file)

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

Description

delete File

License

Open Source License

Declaration

public static void deleteFile(File file) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {
    public static void deleteFile(File file) {
        if (!file.exists() || !file.isFile()) {
            return;
        }/*ww  w .ja v  a2  s  .  c o  m*/
        if (!file.delete()) {
            throw new IllegalStateException("delete file failed: " + file);
        }
    }
}

Related

  1. deleteDirContent(File d)
  2. deleteFile(File f)
  3. deleteFile(File f)
  4. deleteFile(File f)
  5. deleteFile(File file)
  6. deleteFile(File file)
  7. deleteFile(File file)
  8. deleteFile(File file)
  9. deleteFile(File root)