Java File Delete delete(File file)

Here you can find the source of delete(File file)

Description

Delete a file ignoring exceptions.

License

Open Source License

Parameter

Parameter Description
file to delete, can be <code>null</code>

Declaration

public static boolean delete(File file) 

Method Source Code


//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;
        }
    }
}

Related

  1. delete(File file)
  2. delete(File file)
  3. delete(File file)
  4. delete(File file)
  5. delete(File file)
  6. delete(File file)
  7. delete(File file)
  8. delete(File file)
  9. delete(File file)