code: public static void delete(File file) throws IOException {
  		if (file != null) {
  			final LinkedList<File> candidates = new LinkedList<>();
  			candidates.add(file);
  			File fl;
  			File[] children;
  			while (!candidates.isEmpty()) {
  				fl = candidates.getFirst();
  				if (fl.isDirectory()) {
  					children = fl.listFiles();
  					if (children != null && children.length > 0) {
  						// Non empty directory
  						for (final File c : children) {
  							candidates.push(c);
  						}
  					} else {
  						// empty directory
  						candidates.removeFirst();
  						fl.delete();
  					}
  				} else {
  					// not a directory
  					candidates.removeFirst();
  					fl.delete();
  				}
  			}
  		}
  	}
docs: Delete the given directory and all its subdirectories.
  If the given {@code file} is a directory, its
  content and the {@code file} itself are recursivelly removed.
  
  @param file is the file to delete.
  @throws IOException when IO error occurs
  @since 6.0
  @see File#delete() for the deletion on a file only.
  @see File#mkdir() to create a directory.
  @see File#mkdirs() to create a directory and all its parents.