mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-3276 (Edit and Application of Marks to a Single User)
This commit is contained in:
@@ -327,6 +327,30 @@ public final class WebScriptUtils
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a json array from the given {@link String}
|
||||
*
|
||||
* @param json The json array as {@link String}
|
||||
* @return The json array created from the given {@link String}
|
||||
*/
|
||||
public static JSONArray createJSONArray(String json)
|
||||
{
|
||||
mandatory("json", json);
|
||||
|
||||
JSONArray jsonArray;
|
||||
|
||||
try
|
||||
{
|
||||
jsonArray = new JSONArray(json);
|
||||
}
|
||||
catch (JSONException error)
|
||||
{
|
||||
throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Cannot create a json array from the given string '" + json + "'.", error);
|
||||
}
|
||||
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link JSONArray} value of a given key from a json object
|
||||
*
|
||||
|
Reference in New Issue
Block a user