Class MultipartUtil


  • public final class MultipartUtil
    extends java.lang.Object
    MultipartUtil
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MultipartHttpServletRequest convert​(int nSizeThreshold, long nRequestSizeMax, boolean bActivateNormalizeFileName, javax.servlet.http.HttpServletRequest request, boolean isXssSanitize)
      Convert a HTTP request to a MultipartHttpServletRequest
      static boolean isMultipart​(javax.servlet.http.HttpServletRequest request)
      Check if the given HTTP request has multipart content
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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