question: public static boolean deleteDir ( File dir ) { if ( dir == null ) { return false ; } if ( dir . isDirectory ( ) ) { String [ ] children = dir . list ( ) ; for ( String child : children ) { boolean success = deleteDir ( new File ( dir , child ) ) ; if ( ! success ) { return false ; } } } return dir . delete ( ) ; }
target:  Delete a selected directory recursively