Java File Delete delete(File dir)

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

Description

delete

License

Open Source License

Declaration

protected static void delete(File dir) 

Method Source Code


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

import java.io.File;

public class Main {
    protected static void delete(File dir) {
        if (dir.exists() && dir.isDirectory()) {
            for (File file : dir.listFiles()) {
                if (file.isDirectory()) {
                    delete(file);/*  ww w.  ja v a2 s  . c  om*/
                }
                file.delete();
            }
        }
    }
}

Related

  1. delete(File aFile)
  2. delete(File classDir)
  3. delete(File current)
  4. delete(File dir)
  5. delete(File dir)
  6. delete(File f)
  7. delete(File f)
  8. delete(File f)
  9. delete(File f)