Java File Path Delete deleteDir(File f)

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

Description

delete Dir

License

Mozilla Public License

Declaration

private static boolean deleteDir(File f) 

Method Source Code


//package com.java2s;
/*  The contents of this file are subject to the Mozilla Public License     */

import java.io.File;

public class Main {
    private static boolean deleteDir(File f) {
        if (f.isDirectory()) {
            boolean res = true;
            for (File child : f.listFiles()) {
                res = deleteDir(child) && res;
            }//w  w w .  j  a v a  2 s.c o  m
            res = f.delete() && res;
            return res;
        } else {
            return f.delete();
        }
    }
}

Related

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