Closed matthew-morris-cessda closed 1 year ago
The functional change in this PR has been provided in this code snippet. The large diff has been caused by changes in the indentation from tabs to spaces.
if (downloadType.equals(ExportService.DownloadType.SKOS)) {
Map<String, VersionDTO> latestVersionsMap = new LinkedHashMap<>();
for (VersionDTO versionDTO : includedVersions) {
latestVersionsMap.merge(versionDTO.getLanguage(), versionDTO,
// Select the latest version (defined by the lower result from the comparator)
(r, k) -> VocabularyUtils.versionDtoComparator().compare(r, k) < 0 ? r : k
);
}
includedVersions = new LinkedHashSet<>(latestVersionsMap.values());
}
@MartinBobak @Stifo please can you review this code so it can be merged?
This PR only targets SKOS exports, it can be generalised to other export types if required.
This commit also removes writing export files to disk, instead directly serving the files from application memory.
This closes #604.