public class NoEncodingParser extends java.lang.Object implements RequestParser
The created file is stored in the temporary upload directory
(UWSFileManager.getTmpDirectory()
. This directory is supposed to be
emptied regularly in case it is forgotten at any moment by the service
implementation to delete unused request files.
The size of the JDL is limited by the static attribute SIZE_LIMIT
before the creation of the file. Its default value is:
DEFAULT_SIZE_LIMIT
=2097152 bytes.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SIZE_LIMIT
Default maximum allowed size for an HTTP request content: 2 MiB.
|
protected UWSFileManager |
fileManager
File manager to use to create
UploadFile instances. |
static int |
SIZE_LIMIT
Maximum allowed size for an HTTP request content.
|
Constructor and Description |
---|
NoEncodingParser(UWSFileManager fileManager)
Build the request parser.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
parse(javax.servlet.http.HttpServletRequest request)
Extract parameters from the given HTTP request.
|
public static final int DEFAULT_SIZE_LIMIT
public static int SIZE_LIMIT
Maximum allowed size for an HTTP request content. Over this limit, an exception is thrown and the request is aborted.
Note:
The default value is DEFAULT_SIZE_LIMIT
(= 2097152 MiB).
Note:
This limit is expressed in bytes and can not be negative.
Its smallest possible value is 0. If the set value is though negative,
it will be ignored and DEFAULT_SIZE_LIMIT
will be used instead.
protected final UWSFileManager fileManager
UploadFile
instances.
It is required by this new object to execute open, move and delete operations whenever it could be asked.public NoEncodingParser(UWSFileManager fileManager)
fileManager
- A file manager. MUST NOT be NULLpublic java.util.Map<java.lang.String,java.lang.Object> parse(javax.servlet.http.HttpServletRequest request) 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
request
- An HTTP request.Object
s (in which types can be mixed).UWSException
- If any error provides this function to read the parameters.