Here you can find the source of deleteFile(String filePathAndName)
public static boolean deleteFile(String filePathAndName)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static boolean deleteFile(String filePathAndName) { boolean flag = false; try {//from w w w .ja v a 2 s . com String filePath = filePathAndName; File myDelFile = new File(filePath); if (myDelFile.exists()) { myDelFile.delete(); flag = true; } else { flag = false; } } catch (Exception e) { } return flag; } }