use of com.intellij.facet.frameworks.beans.ArtifactItem in project intellij-community by JetBrains.
the class FileSetVersionsFetcherBase method fetchVersions.
@NotNull
@Override
public List<FS> fetchVersions() {
ApplicationManagerEx.getApplicationEx().assertTimeConsuming();
final Artifact[] versions;
if (myGroupId != null) {
versions = LibrariesDownloadAssistant.getVersions(myGroupId, myLocalUrls);
} else {
versions = LibrariesDownloadAssistant.getVersions(myLocalUrls);
}
final List<FS> result = new ArrayList<>();
for (Artifact version : versions) {
final ArtifactItem[] items = version.getItems();
final List<F> files = new ArrayList<>();
for (ArtifactItem item : items) {
String url = item.getUrl();
final String prefix = version.getUrlPrefix();
if (url == null) {
if (prefix != null) {
url = prefix + item.getName();
}
} else {
url = prependPrefix(url, prefix);
}
assert url != null;
files.add(createFileDescription(item, url, prefix));
}
result.add(createVersion(version, files));
}
Collections.sort(result, VERSIONS_COMPARATOR);
return result;
}
Aggregations