question: public static void deleteFile ( final File file , final boolean deleteDir ) { if ( file . isDirectory ( ) ) { for ( final File subFile : file . listFiles ( ) ) { deleteFile ( subFile , true ) ; } if ( deleteDir ) { file . delete ( ) ; } } else { file . delete ( ) ; } }
target:  Deletes the file, or all files in the directory. Optionally the directory itself too.