Java File Delete delete(File f)

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

Description

Delete the file.

License

Open Source License

Parameter

Parameter Description
f the file (may be null).

Return

the outcome of f.close, or true if f is null.

Declaration

public static boolean delete(File f) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {
    /**/*from w w w  .j  ava 2 s .  c o  m*/
     * Delete the file.  Throws no exception (even
     * if file is null).
     *
     * @param f the file (may be null).
     *
     * @return the outcome of <code>f.close</code>,
     *         or true if <code>f</code> is null.
     */
    public static boolean delete(File f) {
        if (f == null) {
            return true;
        }
        return f.delete();
    }
}

Related

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