Here you can find the source of deleteFile(String fileName)
public static boolean deleteFile(String fileName)
//package com.java2s; /**/* w w w .j a v a 2 s.c om*/ * APICloud Studio * Copyright (c) 2014-2015 by APICloud, Inc. All Rights Reserved. * Licensed under the terms of the GNU Public License (GPL) v3. * Please see the license.html included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ import java.io.File; public class Main { public static boolean deleteFile(String fileName) { File file = new File(fileName); if (file.isFile() && file.exists()) { file.delete(); System.out.println("delete file" + fileName + "success"); return true; } else { System.out.println("delete file" + fileName + "fail"); return false; } } }