Skip to content

Commit 330da61

Browse files
KB-11766 :: BE | DEV | Adding the Impl for the Edge case discussion (#23)
1 parent b42c736 commit 330da61

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

certificate-processor/src/main/java/org/sunbird/incredible/processor/views/SvgGenerator.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.apache.commons.lang3.StringUtils;
55
import org.apache.commons.text.StringSubstitutor;
66
import org.sunbird.cloud.storage.BaseStorageService;
7+
import org.sunbird.incredible.processor.JsonKey;
78
import org.sunbird.incredible.processor.store.LocalStore;
89
import org.sunbird.incredible.pojos.CertificateExtension;
910
import org.slf4j.Logger;
@@ -123,7 +124,13 @@ public static String download(String svgTemplate, BaseStorageService storageServ
123124
if (svgTemplate.startsWith("http")) {
124125
try {
125126
String uri = StringUtils.substringAfter(new URL(svgTemplate).getPath(), "/");
126-
container = StringUtils.substringBefore(uri, "/");
127+
String containerName = System.getenv(JsonKey.containerName);
128+
if (StringUtils.isNotBlank(containerName)) {
129+
container = containerName;
130+
} else {
131+
container = StringUtils.substringBefore(uri, "/");
132+
}
133+
127134
relativePath = StringUtils.substringAfter(uri, "/");
128135
} catch (Exception e) {
129136
throw new FileNotFoundException("Invalid URL: " + svgTemplate);

sb-utils/src/main/resources/externalresource.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ sso.enabled=true
4545
specialEventDetailsMap={"2025-09-29#2025-10-03" : {"specialEventName": "NLW_2025" , "L0OrgId" : "01379305664500531251"}}
4646
specialCertificateTemplateMap={"RepublicDay_2025" : "https://storage.googleapis.com/igot/content/do_1144072325325455361196/artifact/do_1144072325325455361196_1758695500248_tricolour_certificate_prod.svg", "NLW_2025": "https://storage.googleapis.com/igot/content/do_1144072325325455361196/artifact/do_1144072325325455361196_1758695500248_tricolour_certificate_prod.svg", "SLW_2025_MinistryOrg" : "https://storage.googleapis.com/igot/content/do_1144072325325455361196/artifact/do_1144072325325455361196_1758695500248_tricolour_certificate_prod.svg"}
4747
special.event.cache.ttl=24
48-
org_read_api=/v1/org/read
48+
org_read_api=/v1/org/read
49+
containerName=igotprod

0 commit comments

Comments
 (0)