Java File Path Delete delAll(String path)

Here you can find the source of delAll(String path)

Description

del All

License

Open Source License

Declaration

public static void delAll(String path) throws Exception 

Method Source Code

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

import java.io.File;

public class Main {
    public static void delAll(String path) throws Exception {
        File f = new File(path);
        if (f.isDirectory()) {
            String[] children = f.list();
            for (String folder : children) {
                String newPath = path + "/" + folder;
                delAll(newPath);//from ww  w  .  j ava 2 s  .c om
            }
        }
        f.delete();
    }
}

Related

  1. delAllFile(String path)
  2. delAllFiles(File dir, String prefix)
  3. delAllFiles(File dir, String suffix)
  4. delDir(String path)