public final class JSONUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
buildJsonError(net.sf.json.JSONObject json,
String strMessage)
Builds a json object with the error message.
|
static net.sf.json.JSONObject |
buildJsonError(String strMessage)
Builds a json object with the error message.
|
static void |
buildJsonSuccess(String strFieldName,
net.sf.json.JSONObject json)
Build the json form success removing file
|
static net.sf.json.JSONObject |
buildJsonSuccess(String strIdEntry,
String strSessionId)
Build the json form success removing file
|
static net.sf.json.JSONObject |
getUploadedFileJSON(List<org.apache.commons.fileupload.FileItem> listFileItem)
Builds a json object for the file item list.
|
static Map<String,String> |
getUserInfos(String strJSON)
Get the user infos.
|
public static net.sf.json.JSONObject buildJsonError(String strMessage)
strMessage
- the error messagepublic static void buildJsonError(net.sf.json.JSONObject json, String strMessage)
json
- the JSONstrMessage
- the error messagepublic static net.sf.json.JSONObject buildJsonSuccess(String strIdEntry, String strSessionId)
strIdEntry
- the id entrystrSessionId
- the session idpublic static void buildJsonSuccess(String strFieldName, net.sf.json.JSONObject json)
strFieldName
- the field name (WARNING : it is not the id entry, it is 'directory_json
- the JSON objectpublic static net.sf.json.JSONObject getUploadedFileJSON(List<org.apache.commons.fileupload.FileItem> listFileItem)
JSON_KEY_UPLOADED_FILES
, value is the array of uploaded file.listFileItem
- the fileItem listpublic static Map<String,String> getUserInfos(String strJSON)
{ "user-attributes": [
{ "user-attribute-key": "user.name.family", "user-attribute-value": "FAMILYNAME" },
{ "user-attribute-key": "user.home-info.online.email", "user-attribute-value": "EMAIL@EMAIL.EMAIL"}
] }
strJSON
- the jsonCopyright © 2017 City of Paris. All rights reserved.