public static JSONObject toJSONObject(Hashtable hashtable) throws JSONException {
JSONObject json = new JSONObject();
Enumeration e = hashtable.keys();
while (e.hasMoreElements()) {
String key = ((String) e.nextElement());
json.accumulate(key, hashtable.get(key));
}
return json;
}
}