mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-2047 (Set classification repository action)
+review RM git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102123 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -317,4 +317,30 @@ public final class WebScriptUtils
|
||||
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link JSONArray} value of a given key from a json object
|
||||
*
|
||||
* @param jsonObject The json object
|
||||
* @param key The key
|
||||
* @return The {@link JSONArray} value of the given key from the json object
|
||||
*/
|
||||
public static JSONArray getJSONArrayFromJSONObject(JSONObject jsonObject, String key)
|
||||
{
|
||||
JSONArray jsonArray;
|
||||
|
||||
mandatory("jsonObject", jsonObject);
|
||||
mandatory("key", key);
|
||||
|
||||
try
|
||||
{
|
||||
jsonArray = jsonObject.getJSONArray(key);
|
||||
}
|
||||
catch (JSONException error)
|
||||
{
|
||||
throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Could not get the json array for the key '" + key + "'.", error);
|
||||
}
|
||||
|
||||
return jsonArray;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user