code: 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;
      }
docs: Attempt to recursively delete a virtual file.
  
  @param root the virtual file to delete
  @return {@code true} if the file was deleted