public static void readProjectLibrariesContent(@NotNull VirtualFile exportedFile, Project project, Collection<String> unknownLibraries)
    throws IOException, JDOMException {
    if (!exportedFile.isValid()) {
      return;
    }

    LibraryTable libraryTable = LibraryTablesRegistrar.getInstance().getLibraryTable(project);
    Element element = JDOMUtil.load(exportedFile.getInputStream());
    WriteAction.run(() -> {
      for (Element libElement : element.getChildren("library")) {
        String libName = libElement.getAttributeValue("name");
        Library libraryByName = libraryTable.getLibraryByName(libName);
        if (libraryByName == null) {
          LibraryTable.ModifiableModel model = libraryTable.getModifiableModel();
          libraryByName = model.createLibrary(libName);
          model.commit();
        }
        Library.ModifiableModel model = libraryByName.getModifiableModel();
        for (Element a : libElement.getChildren("archive")) {
          String rootPath = a.getAttributeValue("path");
          // IDEA-138039 Eclipse import: Unix file system: user library gets wrong paths
          LocalFileSystem fileSystem = LocalFileSystem.getInstance();
          VirtualFile localFile = fileSystem.findFileByPath(rootPath);
          if (rootPath.startsWith("/") && (localFile == null || !localFile.isValid())) {
            // relative to workspace root
            rootPath = project.getBasePath() + rootPath;
            localFile = fileSystem.findFileByPath(rootPath);
          }
          String url = localFile == null ? VfsUtilCore.pathToUrl(rootPath) : localFile.getUrl();
          if (localFile != null) {
            VirtualFile jarFile = JarFileSystem.getInstance().getJarRootForLocalFile(localFile);
            if (jarFile != null) {
              url = jarFile.getUrl();
            }
          }
          model.addRoot(url, OrderRootType.CLASSES);
        }
        model.commit();
        unknownLibraries.remove(libName);  //ignore finally found libraries
      }
    });
  }
public static void readProjectLibrariesContent(@NotNull VirtualFile exportedFile, Project project, Collection<String> unknownLibraries)