use of com.microsoft.azure.toolkit.intellij.azuresdk.model.AzureJavaSdkEntity in project azure-tools-for-java by Microsoft.
the class AzureSdkLibraryService method addClientLibs.
private static void addClientLibs(Map<String, AzureSdkServiceEntity> services) {
getClientLibs().stream().sorted(Comparator.comparing(AzureJavaSdkEntity::getServiceName)).forEachOrdered(raw -> {
final AzureSdkServiceEntity service = getOrCreateService(services, raw);
for (final AzureSdkFeatureEntity feature : service.getContent()) {
final boolean specified = Optional.ofNullable(feature.getClientSource()).filter(s -> s.getGroupId().equals(raw.getGroupId()) && s.getArtifactId().equals(raw.getArtifactId())).isPresent();
final boolean sameFeatureName = trim(feature.getName()).equals(trim(raw.getDisplayName()));
if (specified || sameFeatureName) {
feature.getArtifacts().add(toSdkArtifactEntity(raw));
return;
}
}
// if no mapping feature found.
final AzureSdkFeatureEntity feature = AzureSdkFeatureEntity.builder().name(raw.getDisplayName()).msdocs(raw.getMsdocsUrl()).artifacts(new ArrayList<>(Collections.singletonList(toSdkArtifactEntity(raw)))).build();
service.getContent().add(feature);
});
}
use of com.microsoft.azure.toolkit.intellij.azuresdk.model.AzureJavaSdkEntity in project azure-tools-for-java by Microsoft.
the class AzureSdkLibraryService method addManagementLibs.
private static void addManagementLibs(Map<String, AzureSdkServiceEntity> services) {
getManagementLibs().stream().sorted(Comparator.comparing(AzureJavaSdkEntity::getServiceName)).forEachOrdered(raw -> {
final AzureSdkServiceEntity service = getOrCreateService(services, raw);
for (final AzureSdkFeatureEntity feature : service.getContent()) {
feature.setName(feature.getName().replace("Resource Management - ", "").trim());
feature.getArtifacts().add(toSdkArtifactEntity(raw));
}
});
}
use of com.microsoft.azure.toolkit.intellij.azuresdk.model.AzureJavaSdkEntity in project azure-tools-for-java by Microsoft.
the class AzureSdkLibraryService method loadAzureSDKEntities.
public static List<AzureJavaSdkEntity> loadAzureSDKEntities(final URL destination) {
try {
final ObjectReader reader = CSV_MAPPER.readerFor(AzureJavaSdkEntity.class).with(CsvSchema.emptySchema().withHeader());
final MappingIterator<AzureJavaSdkEntity> data = reader.readValues(destination);
return data.readAll().stream().filter(e -> StringUtils.isNoneBlank(e.getArtifactId(), e.getGroupId())).collect(Collectors.toList());
} catch (final IOException e) {
log.warn(String.format("failed to load Azure SDK list from \"%s\"", destination.toString()), e);
}
return Collections.emptyList();
}
Aggregations