private static <K, V> void deleteIndexFiles(@NotNull final FileBasedIndexExtension<K, V> extension) throws IOException {
    ID<K, V> name = extension.getName();
    var persistentIndexRootDir = IndexInfrastructure.getPersistentIndexRootDir(name);
    if (Files.exists(persistentIndexRootDir)) {
      if (!FileUtil.deleteWithRenaming(persistentIndexRootDir)) {
        LOG.warn("failed to delete persistent index files at " + persistentIndexRootDir);
      }
    }
    var indexRootDir = IndexInfrastructure.getIndexRootDir(name);
    if (Files.exists(indexRootDir)) {
      if (!FileUtil.deleteWithRenaming(indexRootDir)) {
        LOG.warn("failed to delete index files at " + indexRootDir);
      }
    }
  }
private static <K, V> void deleteIndexFiles(@NotNull final FileBasedIndexExtension<K, V> extension)