Java File Path Delete delete(String path)

Here you can find the source of delete(String path)

Description

Attempts to delete the File with the given path.

License

Open Source License

Parameter

Parameter Description
path the File path.

Return

true if the operation succeeded, false otherwise.

Declaration

public static boolean delete(String path) 

Method Source Code

//package com.java2s;

import java.io.File;

public class Main {
    /**//from  w  w  w.j  av a  2 s  . c om
     * Attempts to delete the File with the given path.
     *
     * @param path the File path.
     * @return true if the operation succeeded, false otherwise.
     */
    public static boolean delete(String path) {
        return new File(path).delete();
    }
}

Related

  1. delete(String filePath)
  2. delete(String filePath, boolean recursive)
  3. delete(String path)
  4. delete(String path)
  5. delete(String path)
  6. deleteAll(File path)
  7. deleteAll(File path)
  8. deleteAll(File path)
  9. deleteAllFile(final File dir)