Java Delete Directory deleteDirectory(File f)

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

Description

delete Directory

License

Open Source License

Declaration

public static void deleteDirectory(File f) throws IOException 

Method Source Code


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

public class Main {
    public static void deleteDirectory(File f) throws IOException {
        if (f.isDirectory()) {
            for (File c : f.listFiles()) {
                deleteDirectory(c);/*from   w  w w.j a va 2  s. c o m*/
            }
        }
        if (!f.delete())
            throw new FileNotFoundException("Failed to delete file: " + f);
    }
}

Related

  1. deleteDirectory(File directory)
  2. deleteDirectory(File directory)
  3. deleteDirectory(File directory, boolean ignoreErrors)
  4. deleteDirectory(File f)
  5. deleteDirectory(File f)
  6. deleteDirectory(File f)
  7. deleteDirectory(File file)
  8. deleteDirectory(File file)
  9. deleteDirectory(File file)