public class DefaultMultipartHttpServletRequest extends AbstractMultipartHttpServletRequest
MultipartHttpServletRequest
interface. Provides management of pre-generated parameter values.
Used by CommonsMultipartResolver
.
MultipartResolver
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Constructor and Description |
---|
DefaultMultipartHttpServletRequest(HttpServletRequest request)
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
|
DefaultMultipartHttpServletRequest(HttpServletRequest request,
MultiValueMap<java.lang.String,MultipartFile> mpFiles,
java.util.Map<java.lang.String,java.lang.String[]> mpParams,
java.util.Map<java.lang.String,java.lang.String> mpParamContentTypes)
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMultipartContentType(java.lang.String paramOrFileName)
Determine the content type of the specified request part.
|
HttpHeaders |
getMultipartHeaders(java.lang.String paramOrFileName)
Return the headers associated with the specified part of the multipart request.
|
protected java.util.Map<java.lang.String,java.lang.String> |
getMultipartParameterContentTypes()
Obtain the multipart parameter content type Map for retrieval,
lazily initializing it if necessary.
|
protected java.util.Map<java.lang.String,java.lang.String[]> |
getMultipartParameters()
Obtain the multipart parameter Map for retrieval,
lazily initializing it if necessary.
|
java.lang.String |
getParameter(java.lang.String name)
The default behavior of this method is to return
getParameter(String name) on the wrapped request object.
|
java.util.Map<java.lang.String,java.lang.String[]> |
getParameterMap()
The default behavior of this method is to return getParameterMap()
on the wrapped request object.
|
java.util.Enumeration<java.lang.String> |
getParameterNames()
The default behavior of this method is to return getParameterNames()
on the wrapped request object.
|
java.lang.String[] |
getParameterValues(java.lang.String name)
The default behavior of this method is to return
getParameterValues(String name) on the wrapped request object.
|
protected void |
setMultipartParameterContentTypes(java.util.Map<java.lang.String,java.lang.String> multipartParameterContentTypes)
Set a Map with parameter names as keys and content type Strings as values.
|
protected void |
setMultipartParameters(java.util.Map<java.lang.String,java.lang.String[]> multipartParameters)
Set a Map with parameter names as keys and String array objects as values.
|
getFile, getFileMap, getFileNames, getFiles, getMultiFileMap, getMultipartFiles, getRequest, getRequestHeaders, getRequestMethod, initializeMultipart, isResolved, setMultipartFiles
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
public DefaultMultipartHttpServletRequest(HttpServletRequest request, MultiValueMap<java.lang.String,MultipartFile> mpFiles, java.util.Map<java.lang.String,java.lang.String[]> mpParams, java.util.Map<java.lang.String,java.lang.String> mpParamContentTypes)
request
- the servlet request to wrapmpFiles
- a map of the multipart filesmpParams
- a map of the parameters to expose,
with Strings as keys and String arrays as valuespublic DefaultMultipartHttpServletRequest(HttpServletRequest request)
request
- the servlet request to wrap@Nullable public java.lang.String getParameter(java.lang.String name)
javax.servlet.ServletRequestWrapper
getParameter
in interface ServletRequest
getParameter
in class ServletRequestWrapper
name
- a String
specifying the name of the parameterString
representing the single value of
the parameterServletRequest.getParameterValues(java.lang.String)
public java.lang.String[] getParameterValues(java.lang.String name)
javax.servlet.ServletRequestWrapper
getParameterValues
in interface ServletRequest
getParameterValues
in class ServletRequestWrapper
name
- a String
containing the name of
the parameter whose value is requestedString
objects
containing the parameter's valuesServletRequest.getParameter(java.lang.String)
public java.util.Enumeration<java.lang.String> getParameterNames()
javax.servlet.ServletRequestWrapper
getParameterNames
in interface ServletRequest
getParameterNames
in class ServletRequestWrapper
Enumeration
of String
objects, each String
containing the name of
a request parameter; or an empty Enumeration
if the request has no parameterspublic java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
javax.servlet.ServletRequestWrapper
getParameterMap
in interface ServletRequest
getParameterMap
in class ServletRequestWrapper
public java.lang.String getMultipartContentType(java.lang.String paramOrFileName)
MultipartRequest
paramOrFileName
- the name of the partnull
if not definedpublic HttpHeaders getMultipartHeaders(java.lang.String paramOrFileName)
MultipartHttpServletRequest
If the underlying implementation supports access to headers, then all headers are returned. Otherwise, the returned headers will include a 'Content-Type' header at the very least.
protected final void setMultipartParameters(java.util.Map<java.lang.String,java.lang.String[]> multipartParameters)
protected java.util.Map<java.lang.String,java.lang.String[]> getMultipartParameters()
protected final void setMultipartParameterContentTypes(java.util.Map<java.lang.String,java.lang.String> multipartParameterContentTypes)
protected java.util.Map<java.lang.String,java.lang.String> getMultipartParameterContentTypes()