Class RequestParameterParser


  • public class RequestParameterParser
    extends Object
    • Constructor Detail

      • RequestParameterParser

        public RequestParameterParser()
    • Method Detail

      • parameters

        public static ParameterWrapper parameters​(javax.servlet.http.HttpServletRequest req)
      • parseHeaderParameters

        public static void parseHeaderParameters​(ParameterWrapper parameterWrapper,
                                                 javax.servlet.http.HttpServletRequest request)
      • readFileItems

        public static MultipartRequest readFileItems​(List<org.apache.commons.fileupload.FileItem> items,
                                                     String requestEncoding)
        Reads a list of file items into a map of form field values and a map of uploaded files.
        Parameters:
        items - File items to process.
        requestEncoding - Encoding of the request.
        Returns:
        A map with the form field values and a map with the files.
      • parseMultipart

        public static List<org.apache.commons.fileupload.FileItem> parseMultipart​(javax.servlet.http.HttpServletRequest req)
                                                                           throws org.apache.commons.fileupload.FileUploadException
        Parses a multipart request. Compared with parseMultipartParameters(ParameterWrapper, HttpServletRequest), this method does not apply special handling for formcycle related field names and simply returns the parsed file items. It also does not check whether files contain any data, this should be done by the caller.
        Parameters:
        req - Request to parse.
        Returns:
        A list of file items.
        Throws:
        org.apache.commons.fileupload.FileUploadException - When the request could not be parsed.
      • parseMultipart

        public static List<org.apache.commons.fileupload.FileItem> parseMultipart​(IRequestContext req)
                                                                           throws org.apache.commons.fileupload.FileUploadException
        Parses a multipart request. Compared with parseMultipartParameters(ParameterWrapper, HttpServletRequest), this method does not apply special handling for formcycle related field names and simply returns the parsed file items. It also does not check whether files contain any data, this should be done by the caller.
        Parameters:
        req - Request to parse.
        Returns:
        A list of file items.
        Throws:
        org.apache.commons.fileupload.FileUploadException - When the request could not be parsed.
      • parseMultipart

        public static List<org.apache.commons.fileupload.FileItem> parseMultipart​(javax.servlet.http.HttpServletRequest req,
                                                                                  Predicate<String> fieldFilter)
                                                                           throws org.apache.commons.fileupload.FileUploadException
        Parses a multipart request. Compared with parseMultipartParameters(ParameterWrapper, HttpServletRequest), this method does not apply special handling for formcycle related field names and simply returns the parsed file items. It also does not check whether files contain any data, this should be done by the caller.
        Parameters:
        req - Request to parse.
        fieldFilter - Predicate that is given the name of each submitted form field. When it returns false, that field is discarded.
        Returns:
        A list of file items.
        Throws:
        org.apache.commons.fileupload.FileUploadException - When the request could not be parsed.
      • parseMultipart

        public static List<org.apache.commons.fileupload.FileItem> parseMultipart​(IRequestContext req,
                                                                                  Predicate<String> fieldFilter)
                                                                           throws org.apache.commons.fileupload.FileUploadException
        Parses a multipart request. Compared with parseMultipartParameters(ParameterWrapper, HttpServletRequest), this method does not apply special handling for formcycle related field names and simply returns the parsed file items. It also does not check whether files contain any data, this should be done by the caller.
        Parameters:
        req - Request to parse.
        fieldFilter - Predicate that is given the name of each submitted form field. When it returns false, that field is discarded.
        Returns:
        A list of file items.
        Throws:
        org.apache.commons.fileupload.FileUploadException - When the request could not be parsed.
      • parseMultipartParameters

        public static ParameterWrapper parseMultipartParameters​(ParameterWrapper parameters,
                                                                javax.servlet.http.HttpServletRequest req)
                                                         throws org.apache.commons.fileupload.FileUploadException
        Throws:
        org.apache.commons.fileupload.FileUploadException
      • parseMultipartParameters

        public static ParameterWrapper parseMultipartParameters​(ParameterWrapper parameters,
                                                                IRequestContext req)
                                                         throws org.apache.commons.fileupload.FileUploadException
        Throws:
        org.apache.commons.fileupload.FileUploadException
      • parseMultipartParameters

        public static ParameterWrapper parseMultipartParameters​(ParameterWrapper parameters,
                                                                javax.servlet.http.HttpServletRequest req,
                                                                Predicate<String> fieldFilter)
                                                         throws org.apache.commons.fileupload.FileUploadException
        Throws:
        org.apache.commons.fileupload.FileUploadException