private boolean delete(final File f) throws IOException {

		if (f.isDirectory()) {
			final File[] files = f.listFiles();
			if (files != null) {
				for (File file : files) {
					final boolean del = delete(file);
					if (!del) {
						return false;
					}
				}
			}
		} else {
			return f.delete();
		}

		// Now directory is empty
		return f.delete();
	}
private boolean delete ( final File f ) throws IOException { if ( f . isDirectory ( ) ) { final File [ ] files = f . listFiles ( ) ; if ( files != null ) { for ( File file : files ) { final boolean del = delete ( file ) ; if ( ! del ) { return false ; } } } } else { return f . delete ( ) ; } return f . delete ( ) ; }
Deletes the given file or directory.

@param f
the file to be deleted
@return <code>true</code> if all files were deleted successfully, <code>false</code> otherwise
@throws IOException
thrown if an error occurred while deleting the files/directories