Java Recursive Delete recursiveDelete(File file)

Here you can find the source of recursiveDelete(File file)

Description

recursive Delete

License

LGPL

Declaration

public static void recursiveDelete(File file) throws IOException 

Method Source Code

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

import java.io.File;

import java.io.IOException;

public class Main {
    public static void recursiveDelete(File file) throws IOException {
        if (file == null) {
            return;
        }// w ww.  j a  v a2  s.  c o m
        File[] files = file.listFiles();
        if (files != null) {
            for (File each : files) {
                recursiveDelete(each);
            }
        }
        if (!file.delete()) {
            throw new IOException("Failed to remove " + file);
        }
    }
}

Related

  1. recursiveDelete(File file)
  2. recursiveDelete(File file)
  3. recursiveDelete(File file)
  4. recursiveDelete(File file)
  5. recursiveDelete(File file)
  6. recursiveDelete(File file)
  7. recursiveDelete(File file)
  8. recursiveDelete(File file)
  9. recursiveDelete(File file)