Java Recursive Delete recursiveDelete(File file)

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

Description

Delete Folder with Sub-files

License

Open Source License

Parameter

Parameter Description
file Folder to Delete

Declaration

public static void recursiveDelete(File file) 

Method Source Code

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

import java.io.File;

public class Main {
    /**//  w  ww .ja v a  2 s.c om
     * Delete Folder with Sub-files
     * @param file Folder to Delete
     */
    public static void recursiveDelete(File file) {
        if (!file.exists()) {
            return;
        }
        if (file.isDirectory()) {
            for (File f : file.listFiles()) {
                recursiveDelete(f);
            }
        }
        file.delete();
    }
}

Related

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