Java File Path Delete deleteDirectory(File path)

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

Description

delete Directory

License

Open Source License

Declaration

static public void deleteDirectory(File path) 

Method Source Code

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

import java.io.File;

public class Main {
    static public void deleteDirectory(File path) {
        if (path != null && path.exists()) {
            if (path.isDirectory()) {
                for (File f : path.listFiles()) {
                    deleteDirectory(f);/*from www . j a va 2s.  co  m*/
                }
            }
            path.delete();
        }
    }
}

Related

  1. deleteDir(String path)
  2. deleteDir(String path)
  3. deleteDirByDoc(String path)
  4. deleteDirectory(File directoryPath)
  5. deleteDirectory(File path)
  6. deleteDirectory(File path)
  7. deleteDirectory(File path)
  8. deleteDirectory(File path)
  9. deleteDirectory(File path)