Java File Path Delete deleteDir(File dir)

Here you can find the source of deleteDir(File dir)

Description

delete Dir

License

Apache License

Declaration

public static void deleteDir(File dir) 

Method Source Code


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

import java.io.File;

public class Main {
    public static void deleteDir(File dir) {
        String[] entries = dir.list();
        if (entries != null) {
            for (String name : entries) {
                File file = new File(dir.getPath(), name);
                file.delete();//w  ww.j  a v  a 2  s . c o  m
            }
        }
        dir.delete();
    }
}

Related

  1. deleteDir(File dir)
  2. deleteDir(File dir)
  3. deleteDir(File dir)
  4. deleteDir(File dir)
  5. deleteDir(File dir)
  6. deleteDir(File dir)
  7. deleteDir(File dir)
  8. deleteDir(File dir)
  9. deleteDir(File dir)