use of org.talend.utils.json.JSONException in project tbd-studio-se by Talend.
the class HDFSForm method initHadoopProperties.
private void initHadoopProperties() {
String hadoopProperties = getConnection().getHadoopProperties();
try {
if (StringUtils.isNotEmpty(hadoopProperties)) {
JSONArray jsonArr = new JSONArray(hadoopProperties);
for (int i = 0; i < jsonArr.length(); i++) {
HashMap<String, Object> map = new HashMap();
JSONObject object = jsonArr.getJSONObject(i);
Iterator it = object.keys();
while (it.hasNext()) {
String key = (String) it.next();
map.put(key, object.get(key));
}
properties.add(map);
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
Aggregations