Java Delete Tree delTree(File file)

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

Description

del Tree

License

Apache License

Declaration

public static void delTree(File file) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

public class Main {
    public static void delTree(File file) throws Exception {

        if (file.isFile()) {
            file.delete();// w  w w .jav a  2 s . c  o m
            return;
        }
        if (file.isDirectory()) {
            for (File f : file.listFiles())
                delTree(f);
        }
        file.delete();
    }
}

Related

  1. deltree(File directory)
  2. delTree(File f)
  3. delTree(File file)
  4. delTree(File file)
  5. delTree(File file)
  6. delTree(File file)
  7. delTree(File file)
  8. delTree(File root)
  9. deltree(File root)