Here you can find the source of delfile(String path)
public static boolean delfile(String path)
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.nio.channels.FileChannel; import java.util.ArrayList; public class Main{ public static boolean delfile(String path, String name) { File file = new File(path + Dependence.getPathChar() + name); file.delete();/*ww w.j ava 2s . co m*/ return !file.exists(); } public static boolean delfile(String path) { File file = new File(path); file.delete(); return !file.exists(); } }