use of com.eden.orchid.utilities.OrchidUtils in project Orchid by JavaEden.
the class SetupEnvironment method parseConfigFile.
// config file
private void parseConfigFile(JSONObject options) {
String resPath = "" + options.optString("resourcesDir");
String env = "" + options.optString("environment");
JSONObject configFile = Arrays.stream(dataExtensions).map(ext -> Arrays.stream(formats).map(format -> parseFile(new File(resPath + "/" + Clog.format(format, env, ext)))).filter(OrchidUtils::elementIsObject).map(el -> (JSONObject) el.getElement()).findFirst().orElseGet(() -> null)).findFirst().orElseGet(() -> new JSONObject());
if (configFile.length() > 0) {
for (String key : configFile.keySet()) {
options.put(key, configFile.get(key));
}
}
options.put("config", configFile);
}
Aggregations