Here you can find the source of deleteFile(String name)
public static void deleteFile(String name)
//package com.java2s; // Use of this source code is governed by a BSD-style license that can be import java.io.File; public class Main { public static void deleteFile(String name) { deleteFile(new File(name)); }/* w ww .j av a 2 s . co m*/ public static void deleteFile(File file) { boolean deleted = file.delete(); assert (deleted || !file.exists()); } }