Class JSONUtils
- java.lang.Object
-
- fr.paris.lutece.plugins.asynchronousupload.util.JSONUtils
-
public final class JSONUtils extends java.lang.ObjectProvides json utility methods for forms
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringJSON_KEY_FIELD_NAMEJSON key for field namestatic java.lang.StringJSON_KEY_SUCCESSJSON key to describe a success
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidbuildJsonError(net.sf.json.JSONObject json, java.lang.String strMessage)Builds a json object with the error message.static net.sf.json.JSONObjectbuildJsonErrorRemovingFile(javax.servlet.http.HttpServletRequest request)Builds a json object with the error message.static net.sf.json.JSONObjectgetUploadedFileJSON(java.util.List<org.apache.commons.fileupload.FileItem> listFileItem)Builds a json object for the file item list.
-
-
-
Field Detail
-
JSON_KEY_FIELD_NAME
public static final java.lang.String JSON_KEY_FIELD_NAME
JSON key for field name- See Also:
- Constant Field Values
-
JSON_KEY_SUCCESS
public static final java.lang.String JSON_KEY_SUCCESS
JSON key to describe a success- See Also:
- Constant Field Values
-
-
Method Detail
-
getUploadedFileJSON
public static net.sf.json.JSONObject getUploadedFileJSON(java.util.List<org.apache.commons.fileupload.FileItem> listFileItem)
Builds a json object for the file item list. Key isJSON_KEY_UPLOADED_FILES, value is the array of uploaded file.- Parameters:
listFileItem- the fileItem list- Returns:
- the json
-
buildJsonErrorRemovingFile
public static net.sf.json.JSONObject buildJsonErrorRemovingFile(javax.servlet.http.HttpServletRequest request)
Builds a json object with the error message.- Parameters:
request- the request- Returns:
- the json object.
-
buildJsonError
public static void buildJsonError(net.sf.json.JSONObject json, java.lang.String strMessage)Builds a json object with the error message.- Parameters:
json- the JSONstrMessage- the error message
-
-