public static boolean deleteFolderRecursive ( final File f ) { if ( f . isDirectory ( ) ) { File [ ] files = f . listFiles ( ) ; if ( files == null ) { return false ; } for ( File c : files ) { deleteFolderRecursive ( c ) ; } } return f . delete ( ) ; }
Recursively delete a folder and all its subfolders and files .