Java Delete Directory deleteDirectory(File directory)

Here you can find the source of deleteDirectory(File directory)

Description

delete Directory

License

Open Source License

Declaration

public static boolean deleteDirectory(File directory) 

Method Source Code


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

import java.io.*;

public class Main {
    public static boolean deleteDirectory(File directory) {
        if (directory.isDirectory()) {
            File[] fileList = directory.listFiles();
            if (fileList != null) {
                for (File file : fileList) {
                    deleteDirectory(file);
                }/*from   w  ww.j a va 2 s.c o m*/
            }
        }
        return directory.delete();
    }
}

Related

  1. deleteDirectory(File directory)
  2. deleteDirectory(File directory)
  3. deleteDirectory(File directory)
  4. deleteDirectory(File directory)
  5. deleteDirectory(File directory)
  6. deleteDirectory(File directory)
  7. deleteDirectory(File directory)
  8. deleteDirectory(File directory)
  9. deleteDirectory(File directory)