Here you can find the source of deleteFile(String filePath)
public static boolean deleteFile(String filePath) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; public class Main { public static boolean deleteFile(String filePath) throws IOException { if (filePath == null) return true; File f = new File(filePath); if (f.exists()) { return f.delete(); }/* ww w. j a va 2s.c o m*/ return true; } }