Java Utililty Methods Force Delete

List of utility methods to do Force Delete

Description

The list of methods to do Force Delete are organized into topic(s).

Method

booleanforceDelete(File path)
delete directory recursively.
if (!path.exists())
    return true;
if (path.isDirectory())
    for (File file : path.listFiles()) {
        if (file.toString().equals("."))
            continue;
        if (file.toString().equals(".."))
            continue;
...
voidforceDelete(final File file)
force Delete
if (file.exists()) {
    if (file.isDirectory()) {
        for (final File f : file.listFiles()) {
            forceDelete(f);
    try {
        if (!file.delete()) {
...
voidforceDelete(final File file)
Deletes a file.
if (file.exists()) {
    if (file.isDirectory()) {
        for (final File c : file.listFiles()) {
            forceDelete(c);
    if (!file.delete()) {
        throw new IOException("Failed to delete " + file.getAbsolutePath());
...