private static void delete ( File file ) { if ( file . isDirectory ( ) ) { File [ ] files = file . listFiles ( ) ; if ( files != null ) { for ( File child : files ) { delete ( child ) ; } } } file . delete ( ) ; }
Recursive delete of a file or directory .