Here you can find the source of deleteFile(String path)
public static void deleteFile(String path) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; import java.nio.file.Files; public class Main { public static void deleteFile(String path) throws IOException { Files.delete(new File(path).toPath()); }//from w ww. j a v a 2 s . c o m }