Android File Delete safelyDeleteFile(File filePath)

Here you can find the source of safelyDeleteFile(File filePath)

Description

safely Delete File

Declaration

public static void safelyDeleteFile(File filePath) 

Method Source Code

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

public class Main {
    public static void safelyDeleteFile(String filePath) {
        safelyDeleteFile(new File(filePath));
    }//from  ww w  .j ava 2 s . com

    public static void safelyDeleteFile(File filePath) {
        if (filePath != null && filePath.exists()) {
            filePath.delete();
        }
    }
}

Related

  1. forceDelete(final File file)
  2. recursiveDelete(File fileOrDir)
  3. recursiveDelete(File path)
  4. removeableFile(File folder, String fileName)
  5. renameFile(String strSrc, String strDest, boolean deleteIfExist)
  6. safelyDeleteFile(String filePath)
  7. deleteFolderFile(String filePath, boolean deleteThisPath)
  8. deleteFile(File f)
  9. deleteFile(File file)