Class JSONUtils
java.lang.Object
fr.paris.lutece.plugins.asynchronousupload.util.JSONUtils
Provides json utility methods for forms
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbuildJsonError(com.fasterxml.jackson.databind.node.ObjectNode json, String strMessage) Builds a json object with the error message.static com.fasterxml.jackson.databind.node.ObjectNodebuildJsonErrorRemovingFile(javax.servlet.http.HttpServletRequest request) Builds a json object with the error message.static com.fasterxml.jackson.databind.node.ObjectNodegetUploadedFileJSON(List<org.apache.commons.fileupload.FileItem> listFileItem) Builds a json object for the file item list.
-
Field Details
-
JSON_KEY_FIELD_NAME
JSON key for field name- See Also:
-
JSON_KEY_SUCCESS
JSON key to describe a success- See Also:
-
-
Method Details
-
getUploadedFileJSON
public static com.fasterxml.jackson.databind.node.ObjectNode getUploadedFileJSON(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 com.fasterxml.jackson.databind.node.ObjectNode 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(com.fasterxml.jackson.databind.node.ObjectNode json, String strMessage) Builds a json object with the error message.- Parameters:
json- the JSONstrMessage- the error message
-