Java File Path Delete delDirAndFile(String tempath)

Here you can find the source of delDirAndFile(String tempath)

Description

del Dir And File

License

Open Source License

Declaration

public static void delDirAndFile(String tempath) 

Method Source Code


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

public class Main {

    public static void delDirAndFile(String tempath) {
        File f = new File(tempath);
        if (f.isDirectory()) {
            File[] l = f.listFiles();
            for (int i = 0; i < l.length; i++) {
                delDirAndFile(l[i].getAbsolutePath());
            }/*from  w ww.j av  a 2s  .  c  om*/
        }
        f.delete();
    }
}

Related

  1. delAll(String path)
  2. delAllFile(String path)
  3. delAllFiles(File dir, String prefix)
  4. delAllFiles(File dir, String suffix)
  5. delDir(String path)
  6. deleleFiles(String regex, String path)
  7. delEmptyPath(String path)
  8. delete(File path)
  9. delete(File path)