Android File Delete safelyDeleteFile(String filePath)

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

Description

safely Delete File

Declaration

public static void safelyDeleteFile(String filePath) 

Method Source Code

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

public class Main {
    public static void safelyDeleteFile(String filePath) {
        safelyDeleteFile(new File(filePath));
    }/*w w  w. java  2s.  c o  m*/

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

Related

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