public static Promise<List<OrderRoot>> deleteAndReloadDependencies(@NotNull final Project project,
                                                                     @NotNull final LibraryEx library) throws IOException {
    LOG.debug("start deleting files in library " + library.getName());
    var filesToDelete = new ArrayList<VirtualFile>();
    for (var rootType : OrderRootType.getAllTypes()) {
      Collections.addAll(filesToDelete, library.getRootProvider().getFiles(rootType));
    }

    for (VirtualFile file : filesToDelete) {
      if (file.getFileSystem() instanceof ArchiveFileSystem archiveFs) {
        var local = archiveFs.getLocalByEntry(file);
        if (null != local) {
          var path = local.toNioPath();
          FileUtil.delete(path);
        }
      }
    }
    return reloadDependencies(project, library);
  }
public static Promise<List<OrderRoot>> deleteAndReloadDependencies(@NotNull final Project project,
                                                                     @NotNull final LibraryEx library)