code: private static synchronized int deleteRecursively(File directory) {
  		int deleted = 0;
  		if(directory.isDirectory()) {
  			File[] contents = directory.listFiles();
  			for(File file : contents) {
  				deleted += deleteRecursively(file);
  			}
  		} else {
  			deleted++;
  		}
  		directory.delete();
  		return deleted;
  	}
docs: Deletes the given directory recursively, i.e., bottom-up.
  @param directory Directory to be deleted.
  @return The number of files deleted.