public static boolean clearDirectory ( File directory ) { if ( directory . isDirectory ( ) ) { for ( File file : directory . listFiles ( ) ) { if ( ! deleteRecursive ( file ) ) { return false ; } } } return true ; }
Recursively removes all entries from a directory .