class IdeaJarLibraryDependencyFactory {

  @Nullable
  public JarLibraryDependency create(@NotNull IdeaSingleEntryLibraryDependency original) {
    File binaryPath = original.getFile();
    if (binaryPath == null) {
      return null;
    }
    String scope = null;
    IdeaDependencyScope originalScope = original.getScope();
    if (originalScope != null) {
      scope = originalScope.getScope();
    }
    boolean resolved = JarLibraryDependency.isResolved(binaryPath.getName());
    String name = JarLibraryDependency.getDependencyName(binaryPath, resolved);
    return new JarLibraryDependency(name, binaryPath, original.getSource(), original.getJavadoc(), scope,
                                    original.getGradleModuleVersion(), resolved);
  }

}