private void delete ( File file ) { if ( file . isDirectory ( ) ) { File [ ] children = file . listFiles ( ) ; for ( File child : children ) { delete ( child ) ; } } if ( ! file . delete ( ) ) { if ( ! file . isDirectory ( ) ) { logger . warn ( "Unable to clean/delete file: {}" , file ) ; } else { logger . debug ( "Unable to clean/delete directory: {}" , file ) ; } } }
Recursively deletes a directory and all it s files