Package de.xima.fc.form.request
Class RequestParameterParser
- java.lang.Object
-
- de.xima.fc.form.request.RequestParameterParser
-
public class RequestParameterParser extends Object
-
-
Constructor Summary
Constructors Constructor Description RequestParameterParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ParameterWrapper
parameters(javax.servlet.http.HttpServletRequest req)
static void
parseHeaderParameters(ParameterWrapper parameterWrapper, javax.servlet.http.HttpServletRequest request)
static List<org.apache.commons.fileupload.FileItem>
parseMultipart(IRequestContext req)
Parses a multipart request.static List<org.apache.commons.fileupload.FileItem>
parseMultipart(IRequestContext req, Predicate<String> fieldFilter)
Parses a multipart request.static List<org.apache.commons.fileupload.FileItem>
parseMultipart(javax.servlet.http.HttpServletRequest req, Predicate<String> fieldFilter)
Parses a multipart request.static ParameterWrapper
parseMultipartParameters(ParameterWrapper parameters, IRequestContext req)
static ParameterWrapper
parseMultipartParameters(ParameterWrapper parameters, IRequestContext req, Predicate<String> fieldFilter)
static ParameterWrapper
parseMultipartParameters(ParameterWrapper parameters, javax.servlet.http.HttpServletRequest req)
static ParameterWrapper
parseMultipartParameters(ParameterWrapper parameters, javax.servlet.http.HttpServletRequest req, Predicate<String> fieldFilter)
static ParameterWrapper
parseURLParameters(ParameterWrapper parameters, javax.servlet.http.HttpServletRequest req)
static ParameterWrapper
parseURLParameters(ParameterWrapper parameters, javax.servlet.http.HttpServletRequest req, Predicate<String> fieldFilter)
-
-
-
Method Detail
-
parameters
public static ParameterWrapper parameters(javax.servlet.http.HttpServletRequest req)
-
parseHeaderParameters
public static void parseHeaderParameters(ParameterWrapper parameterWrapper, javax.servlet.http.HttpServletRequest request)
-
parseURLParameters
public static ParameterWrapper parseURLParameters(ParameterWrapper parameters, javax.servlet.http.HttpServletRequest req)
-
parseURLParameters
public static ParameterWrapper parseURLParameters(ParameterWrapper parameters, javax.servlet.http.HttpServletRequest req, Predicate<String> fieldFilter)
-
parseMultipart
public static List<org.apache.commons.fileupload.FileItem> parseMultipart(IRequestContext req) throws org.apache.commons.fileupload.FileUploadException
Parses a multipart request. Compared withparseMultipartParameters(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 withparseMultipartParameters(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 returnsfalse
, 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 withparseMultipartParameters(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 returnsfalse
, 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
-
parseMultipartParameters
public static ParameterWrapper parseMultipartParameters(ParameterWrapper parameters, IRequestContext req, Predicate<String> fieldFilter) throws org.apache.commons.fileupload.FileUploadException
- Throws:
org.apache.commons.fileupload.FileUploadException
-
-