Here you can find the source of delete(File file)
Parameter | Description |
---|---|
file | to delete, can be <code>null</code> |
public static boolean delete(File file)
//package com.java2s; import java.io.File; public class Main { /**/*from w ww. j a v a2 s. c o m*/ * Delete a file ignoring exceptions. * @param file to delete, can be <code>null</code> */ public static boolean delete(File file) { if (file == null) { return false; } try { return file.delete(); } catch (Exception e) { e.printStackTrace(); return false; } } }