Java File Path Delete deleteDirs(File path)

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

Description

delete Dirs

License

Open Source License

Declaration

private static void deleteDirs(File path) 

Method Source Code


//package com.java2s;
import java.io.File;

public class Main {

    private static void deleteDirs(File path) {
        File[] files = null;/*from w w  w .  java  2 s  .  c  om*/
        if (path.isDirectory()) {
            path.delete();
            files = path.listFiles();
            if (files != null) {
                for (int i = 0; i < files.length; i++) {
                    deleteDirs(files[i]);
                }
            }
        }
        path.delete();
    }
}

Related

  1. deleteDirectoryRecursively(File path)
  2. deleteDirectoryRecursivly(String path)
  3. deleteDirectoryTree(String directoryPath)
  4. deleteDirRecursive(String dirPath)
  5. deleteDirRecursive(String path)
  6. deleteDirs(String pathname)
  7. deleteDirWithContent(final String path)
  8. deleteEmptDir(String Path, String username)
  9. deleteEmptyDir(File dstPath)