Java File Path Delete deleteFolder(String path)

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

Description

delete Folder

License

LGPL

Declaration

public static void deleteFolder(String path) 

Method Source Code


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

import java.io.File;

public class Main {
    public static void deleteFolder(String path) {
        deleteFolder(new File(path));
    }/* ww  w . ja v a  2s.  c o m*/

    public static void deleteFolder(File dir) {
        if (dir.isDirectory()) {
            String[] children = dir.list();
            for (int i = 0; i < children.length; i++)
                deleteFolder(new File(dir, children[i]));
        }
        dir.delete();
    }
}

Related

  1. deleteFolder(String folderPath)
  2. deleteFolder(String folderPath)
  3. deleteFolder(String folderPath)
  4. deleteFolder(String path)
  5. deleteFolder(String path)
  6. deleteFolder(String path)
  7. deleteFolder(String path)
  8. deleteFolder(String path)
  9. deleteFolder(String path)