Unverified Commit 41077fc8 authored by Reshmi V Nair's avatar Reshmi V Nair Committed by GitHub
Browse files

Merge pull request #504 from BharathwajShankar/LR-278

LR-278 - File URL is not having new cname changes fix
Showing with 13 additions and 3 deletions
+13 -3
...@@ -233,10 +233,15 @@ public class QRCodeDownloadManagementActor extends BaseActor { ...@@ -233,10 +233,15 @@ public class QRCodeDownloadManagementActor extends BaseActor {
List<Map<String, Object>> listOfMap = (List<Map<String, Object>>) obj; List<Map<String, Object>> listOfMap = (List<Map<String, Object>>) obj;
if (CollectionUtils.isNotEmpty(listOfMap)) { if (CollectionUtils.isNotEmpty(listOfMap)) {
//TODO Resolve it and store. Assuming dial code db will have the template url with data migration script //TODO Resolve it and store. Assuming dial code db will have the template url with data migration script
//check if template url contains dail storage base path,if yes then append it with cnameurl and dial bucket name
String templateUrl = (String) listOfMap.get(0).get("url"); String templateUrl = (String) listOfMap.get(0).get("url");
//replace template url with the actual cloud url String dailStorageBasePath = getConfigValue(DIAL_STORAGE_BASE_PATH_PLACEHOLDER);
if (templateUrl.contains(getConfigValue(CLOUD_STORE_BASE_PATH_PLACEHOLDER))) String cnameUrl = getConfigValue(CLOUD_STORAGE_CNAME_URL);
templateUrl = templateUrl.replace(getConfigValue(CLOUD_STORE_BASE_PATH_PLACEHOLDER), getConfigValue(CLOUD_STORE_BASE_PATH)); if (templateUrl.contains(dailStorageBasePath))
templateUrl = templateUrl.replace(dailStorageBasePath,
cnameUrl.isEmpty() ? getConfigValue(CLOUD_STORE_BASE_PATH) :cnameUrl
+ "/" + getConfigValue(CLOUD_STORAGE_DIAL_BUCKET_NAME));
return templateUrl; return templateUrl;
} }
} }
......
...@@ -789,6 +789,9 @@ public final class JsonKey { ...@@ -789,6 +789,9 @@ public final class JsonKey {
public static final String CLOUD_FOLDER_CONTENT = "sunbird_cloud_content_folder"; public static final String CLOUD_FOLDER_CONTENT = "sunbird_cloud_content_folder";
public static final String CLOUD_STORE_BASE_PATH = "cloud_storage_base_url"; public static final String CLOUD_STORE_BASE_PATH = "cloud_storage_base_url";
public static final String CLOUD_STORAGE_CNAME_URL= "cloud_storage_cname_url";
public static final String CLOUD_STORAGE_DIAL_BUCKET_NAME = "cloud_storage_dial_bucketname";
public static final String DIAL_STORAGE_BASE_PATH_PLACEHOLDER="DIAL_STORAGE_BASE_PATH";
public static final String CLOUD_STORE_BASE_PATH_PLACEHOLDER = "cloud_store_base_path_placeholder"; public static final String CLOUD_STORE_BASE_PATH_PLACEHOLDER = "cloud_store_base_path_placeholder";
public static final String TO_URL = "toUrl"; public static final String TO_URL = "toUrl";
public static final String TTL = "ttl"; public static final String TTL = "ttl";
......
...@@ -207,4 +207,6 @@ sunbird_msg_91_auth= ...@@ -207,4 +207,6 @@ sunbird_msg_91_auth=
sunbird_api_mgr_base_url=https://dev.sunbirded.org/api sunbird_api_mgr_base_url=https://dev.sunbirded.org/api
enrollment_list_size=1000 enrollment_list_size=1000
cloud_storage_base_url=https://sunbirddev.blob.core.windows.net cloud_storage_base_url=https://sunbirddev.blob.core.windows.net
cloud_storage_cname_url=https://obj.stage.sunbirded.org
cloud_storage_dial_bucketname=dial
cloud_store_base_path_placeholder=$CLOUD_BASE_PATH cloud_store_base_path_placeholder=$CLOUD_BASE_PATH
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment