Here you can find the source of deleteFile(String path)
public static void deleteFile(String path)
//package com.java2s; import java.io.*; public class Main { public static void deleteFile(String path) { File file = new File(path); deleteFile(file);//from w w w . j a v a 2 s . c o m } public static void deleteFile(File file) { if (file.exists()) { file.delete(); } } }