public static void deleteDirectory ( File fileOrDirectory ) { if ( fileOrDirectory . isDirectory ( ) ) for ( File child : fileOrDirectory . listFiles ( ) ) deleteDirectory ( child ) ; fileOrDirectory . delete ( ) ; }
Delete a directory and all its contents