Java File Delete delete(File file)

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

Description

delete

License

Open Source License

Declaration

public static void delete(File file) 

Method Source Code

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

import java.io.File;

public class Main {
    public static void delete(File file) {
        delete(file, false);//from  w w w . ja  va  2  s . c om
    }

    public static void delete(File file, boolean verbose) {
        if (file.isDirectory()) {
            File[] children = file.listFiles();

            for (int i = 0; i < children.length; i++) {
                delete(children[i], verbose);
            }
        }
        if (verbose) {
            System.out.println("Deleting: " + file.getAbsolutePath());
        }
        file.delete();
    }
}

Related

  1. delete(File file)
  2. delete(File file)
  3. delete(File file)
  4. delete(File file)
  5. delete(File file)
  6. delete(File file)
  7. delete(File file)
  8. delete(File file)
  9. doDelete(File f)