public static boolean recursiveDelete ( VirtualFile root ) { boolean ok = true ; if ( root . isDirectory ( ) ) { final List < VirtualFile > files = root . getChildren ( ) ; for ( VirtualFile file : files ) { ok &= recursiveDelete ( file ) ; } return ok && ( root . delete ( ) || ! root . exists ( ) ) ; } else { ok &= root . delete ( ) || ! root . exists ( ) ; } return ok ; }
Attempt to recursively delete a virtual file .