use of com.google.gerrit.extensions.common.DownloadInfo in project gerrit by GerritCodeReview.
the class GetServerInfo method getDownloadInfo.
private DownloadInfo getDownloadInfo(DynamicMap<DownloadScheme> downloadSchemes, DynamicMap<DownloadCommand> downloadCommands, DynamicMap<CloneCommand> cloneCommands, AllowedFormats archiveFormats) {
DownloadInfo info = new DownloadInfo();
info.schemes = new HashMap<>();
for (DynamicMap.Entry<DownloadScheme> e : downloadSchemes) {
DownloadScheme scheme = e.getProvider().get();
if (scheme.isEnabled() && scheme.getUrl("${project}") != null) {
info.schemes.put(e.getExportName(), getDownloadSchemeInfo(scheme, downloadCommands, cloneCommands));
}
}
info.archives = archiveFormats.getAllowed().stream().map(ArchiveFormat::getShortName).collect(toList());
return info;
}
use of com.google.gerrit.extensions.common.DownloadInfo in project gerrit by GerritCodeReview.
the class GetServerInfo method getDownloadInfo.
private DownloadInfo getDownloadInfo() {
DownloadInfo info = new DownloadInfo();
info.schemes = new HashMap<>();
downloadSchemes.runEach(extension -> {
DownloadScheme scheme = extension.get();
if (scheme.isEnabled() && scheme.getUrl("${project}") != null) {
info.schemes.put(extension.getExportName(), getDownloadSchemeInfo(scheme));
}
});
info.archives = archiveFormats.getAllowed().stream().map(ArchiveFormatInternal::getShortName).collect(toList());
return info;
}
Aggregations