Here you can find the source of delete(String filePath)
public static void delete(String filePath) throws IOException
//package com.java2s; import java.io.File; import java.io.IOException; public class Main { public static void delete(String filePath) throws IOException { boolean result = new File(filePath).delete(); if (!result) { throw new IOException("Delete " + filePath + " failed!"); }// w ww .ja va2 s . c o m } }