Here you can find the source of deleteFile(final String filePathName)
public static boolean deleteFile(final String filePathName) throws IllegalArgumentException
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static boolean deleteFile(final String filePathName) throws IllegalArgumentException { if (doesFileExist(filePathName)) { File file = new File(filePathName); return file.delete(); }/*from w w w .j a v a 2 s. c o m*/ return true; } public static boolean doesFileExist(final String filePathName) { File file = new File(filePathName); return file.isFile() && file.exists(); } }