Class MultipartUtil

java.lang.Object
fr.paris.lutece.util.http.MultipartUtil

public final class MultipartUtil extends Object
MultipartUtil
  • Method Details

    • isMultipart

      public static boolean isMultipart(javax.servlet.http.HttpServletRequest request)
      Check if the given HTTP request has multipart content
      Parameters:
      request - the HTTP request
      Returns:
      true if it has multipart content, false otherwise
    • convert

      public static MultipartHttpServletRequest convert(int nSizeThreshold, long nRequestSizeMax, boolean bActivateNormalizeFileName, javax.servlet.http.HttpServletRequest request, boolean isXssSanitize) throws org.apache.commons.fileupload.FileUploadException
      Convert a HTTP request to a MultipartHttpServletRequest
      Parameters:
      nSizeThreshold - the size threshold
      nRequestSizeMax - the request size max
      bActivateNormalizeFileName - true if the file name must be normalized, false otherwise
      request - the HTTP request
      Returns:
      a MultipartHttpServletRequest, null if the request does not have a multipart content
      Throws:
      org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException - exception if the file size is too big
      org.apache.commons.fileupload.FileUploadException - exception if an unknown error has occurred