Here you can find the source of deleteFileIfExists(String path)
public static boolean deleteFileIfExists(String path)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static boolean deleteFileIfExists(String path) { File f = new File(path); if (f.exists() && !f.isDirectory()) { return f.delete(); }/* w w w . ja v a 2s . c om*/ return false; } }