Java File Path Delete deleteDir(File f)

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

Description

delete Dir

License

Open Source License

Declaration

private static void deleteDir(File f) 

Method Source Code


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

import java.io.File;

public class Main {
    private static void deleteDir(File f) {
        File[] subs = f.listFiles();
        for (int i = 0; i < subs.length; i++) {
            File sub = subs[i];//from w  w  w  . ja va2 s.c  om
            if (sub.isDirectory()) {
                deleteDir(sub);
            } else {
                sub.delete();
            }
        }
        f.delete();
    }
}

Related

  1. deleteDir(File directory)
  2. deleteDir(File directory)
  3. deleteDir(File directory, boolean removeAll)
  4. deleteDir(File dirFile)
  5. deleteDir(File dirPath)
  6. deleteDir(File f)
  7. deleteDir(File f)
  8. deleteDir(File fDir)
  9. deleteDir(File file)