{
\"204\": {
\"host\": \"https:\\/\\/abc.com\\/production-source\\/ChangSha\\/2013\\/12\\/02\\/0\\/0\\/A\\/Content\\/\",
\"timestamp\": 138590988
User this method to iterate json dynamically
private void parseJson(JSONObject data) {
if (data != null) {
Iterator it = data.keys();
while (it.hasNext()) {
String key = it.next();
try {
if (data.get(key) instanceof JSONArray) {
JSONArray arry = data.getJSONArray(key);
int size = arry.length();
for (int i = 0; i < size; i++) {
parseJson(arry.getJSONObject(i));
}
} else if (data.get(key) instanceof JSONObject) {
parseJson(data.getJSONObject(key));
} else {
System.out.println("" + key + " : " + data.optString(key));
}
} catch (Throwable e) {
System.out.println("" + key + " : " + data.optString(key));
e.printStackTrace();
}
}
}
}