Java Folder Delete emptyFolder(File toEmpty)

Here you can find the source of emptyFolder(File toEmpty)

Description

empty Folder

License

Open Source License

Declaration

private static void emptyFolder(File toEmpty) 

Method Source Code

//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

import java.io.File;

public class Main {
    private static void emptyFolder(File toEmpty) {
        for (File current : toEmpty.listFiles()) {
            if (current.isDirectory()) {
                emptyFolder(current);//from  w  w w . j  a  va2 s . c o m
            }
            current.delete();
        }
    }
}

Related

  1. emptyFile(String srcFilename)
  2. emptyFolder(File dir)
  3. emptyFolder(File folder)
  4. emptyFolder(File folder)
  5. emptyFolder(File folder, boolean ignoreCannotDel)
  6. emptyFolder(final File folder)
  7. emptyFolder(final File folder)