public class TAPRequestParser extends java.lang.Object implements RequestParser
FormEncodedParser
MultipartParser
The request body size is limited for the multipart. You can change these
limits with the constructor
TAPRequestParser(UWSFileManager, boolean, long, long)
Note:
If you want to support other request parsing, you have to write your own
RequestParser
implementation.
Constructor and Description |
---|
TAPRequestParser(UWSFileManager fileManager)
Build a
RequestParser able to choose the most appropriate
RequestParser in function of the request content-type. |
TAPRequestParser(UWSFileManager fileManager,
boolean uploadEnabled,
long maxFileSize,
long maxRequestSize)
Build a
RequestParser able to choose the most appropriate
RequestParser in function of the request content-type. |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
parse(javax.servlet.http.HttpServletRequest req)
Extract parameters from the given HTTP request.
|
public TAPRequestParser(UWSFileManager fileManager)
RequestParser
able to choose the most appropriate
RequestParser
in function of the request content-type.fileManager
- The file manager to use in order to store any
eventual upload. MUST NOT be NULLpublic TAPRequestParser(UWSFileManager fileManager, boolean uploadEnabled, long maxFileSize, long maxRequestSize)
RequestParser
able to choose the most appropriate
RequestParser
in function of the request content-type.fileManager
- The file manager to use in order to store any
eventual upload. MUST NOT be NULLuploadEnabled
- true
to support UPLOADs,
false
otherwise (i.e. all Multipart
requests with files will be rejected).maxFileSize
- Maximum size for a single uploaded file.
A negative value means "no limit".maxRequestSize
- Maximum size for a whole Multipart HTTP Request.
A negative value means "no limit".public java.util.Map<java.lang.String,java.lang.Object> parse(javax.servlet.http.HttpServletRequest req) throws UWSException
RequestParser
Extract parameters from the given HTTP request.
These parameters can be fetched from ServletRequest.getParameterMap()
or directly from the full request content. In this last case, a parsing is necessary ;
hence this function.
In case a parameter is provided several times with the same time and the same case,
the request parser can choose to keep only the last occurrence or all occurrences.
If all occurrences are kept, this function MUST return an array of Object
s
(in which types may be mixed), otherwise a map value MUST be an elementary object.
Note: A parameter item can be a simple value (e.g. String, integer, ...) or a more complex object (e.g. File, InputStream, ...).
IMPORTANT:
This function MUST NOT be used to check the parameters' value.
It only aims to parse the given request in order to extract its embedded parameters.
Consequently, if this function throws an exception, it could be only because the request
can not be read, and not because a parameter format or value is incorrect.
Parameter checks should be done in UWSParameters
and more particularly by
an InputParamController
.
parse
in interface RequestParser
req
- An HTTP request.Object
s (in which types can be mixed).UWSException
- If any error provides this function to read the parameters.