Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohandey committed Sep 25, 2023
2 parents d9bab08 + 33a548d commit a60fbaf
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,14 @@ public static String getValueFromActuators(String endPoint, String section, Stri
responseJson = new org.json.JSONObject(response.getBody().asString());
idaActuatorResponseArray = responseJson.getJSONArray("propertySources");
}

logger.info("idaActuatorResponseArray="+idaActuatorResponseArray);

for (int i = 0, size = idaActuatorResponseArray.length(); i < size; i++) {
org.json.JSONObject eachJson = idaActuatorResponseArray.getJSONObject(i);
if (eachJson.get("name").toString().contains(section)) {
value = eachJson.getJSONObject(GlobalConstants.PROPERTIES).getJSONObject(key)
.get(GlobalConstants.VALUE).toString();
logger.info("value="+value);
break;
}
}
Expand All @@ -551,23 +552,30 @@ public static List<String> getLanguageList() {
return languageList;
}
String section = "";

String optionalLanguages=null;
String mandatoryLanguages=null;
if (isTargetEnvLTS())
section = "/mosip/mosip-config/application-default.properties";
else
section = "/mosip/mosip-config/sandbox/admin-mz.properties";

String mandatoryLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"),
section, "mosip.mandatory-languages");
String optionalLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"),
try {

optionalLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"),
section, "mosip.optional-languages");

logger.info("optionalLanguages from env:" + optionalLanguages);
mandatoryLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"),
section, "mosip.mandatoryLanguages from env:" + mandatoryLanguages);
}
catch(Exception e)
{
e.printStackTrace();
}
if (mandatoryLanguages != null && !mandatoryLanguages.isBlank())
languageList.addAll(Arrays.asList(mandatoryLanguages.split(",")));

if (optionalLanguages != null && !optionalLanguages.isBlank())
languageList.addAll(Arrays.asList(optionalLanguages.split(",")));

logger.info("languageList from env:" + languageList);
return languageList;
}

Expand Down

0 comments on commit a60fbaf

Please sign in to comment.