java.lang.Object
fr.paris.lutece.plugins.asynchronousupload.util.JSONUtils

public final class JSONUtils extends Object
Provides json utility methods for forms
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    JSON key for field name
    static final String
    JSON key to describe a success
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    buildJsonError(com.fasterxml.jackson.databind.node.ObjectNode json, String strMessage)
    Builds a json object with the error message.
    static com.fasterxml.jackson.databind.node.ObjectNode
    buildJsonErrorRemovingFile(jakarta.servlet.http.HttpServletRequest request)
    Builds a json object with the error message.
    static com.fasterxml.jackson.databind.node.ObjectNode
    getUploadedFileJSON(List<fr.paris.lutece.portal.service.upload.MultipartItem> listFileItem)
    Builds a json object for the file item list.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • getUploadedFileJSON

      public static com.fasterxml.jackson.databind.node.ObjectNode getUploadedFileJSON(List<fr.paris.lutece.portal.service.upload.MultipartItem> listFileItem)
      Builds a json object for the file item list. Key is JSON_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(jakarta.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 JSON
      strMessage - the error message