Android File Delete deleteFile(String fileName)

Here you can find the source of deleteFile(String fileName)

Description

delete File

License

Open Source License

Declaration

public static boolean deleteFile(String fileName) 

Method Source Code

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

import java.io.File;

public class Main {

    public static boolean deleteFile(String fileName) {

        try {//  w  w  w .  ja va  2s .c  om
            File directory = new File(fileName);

            return directory.delete();
        } catch (Throwable e) {
            return false;
        }

    }
}

Related

  1. deleteFolderFile(String filePath, boolean deleteThisPath)
  2. deleteFile(File f)
  3. deleteFile(File file)
  4. deleteFile(String filePath)
  5. delete(File file)
  6. DeleteFile(File file)