public boolean deleteIfExists (Path path) throws IOException

Deletes a file if it exists. This method works in exactly the manner specified by the Files.deleteIfExists method.

The default implementation of this method simply invokes delete ignoring the NoSuchFileException when the file does not exist. It may be overridden where appropriate.

path     the path to the file to delete

Returns:  true if the file was deleted by this method; false if the file could not be deleted because it did not exist

DirectoryNotEmptyException     if the file is a directory and could not otherwise be deleted because the directory is not empty (optional specific exception)
IOException     if an I/O error occurs
SecurityException     In the case of the default provider, and a security manager is installed, the SecurityManager.checkDelete(String) method is invoked to check delete access to the file