in util/src/main/java/com/google/cloud/healthcare/imaging/dicomadapter/JsonUtil.java [25:41]
public static JSONArray parseConfig(String jsonInline, String jsonPath, String jsonEnvKey)
throws IOException {
JSONArray result = null;
if (jsonInline != null && jsonInline.length() > 0) {
result = new JSONArray(jsonInline);
} else if (jsonPath != null && jsonPath.length() > 0) {
result = new JSONArray(new String(
Files.readAllBytes(Paths.get(jsonPath)), StandardCharsets.UTF_8));
} else {
String jsonEnvValue = System.getenv(jsonEnvKey);
if (jsonEnvValue != null) {
result = new JSONArray(jsonEnvValue);
}
}
return result;
}