Class DefaultMultipartHttpServletRequest
java.lang.Object
jakarta.servlet.ServletRequestWrapper
jakarta.servlet.http.HttpServletRequestWrapper
org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
- All Implemented Interfaces:
- HttpServletRequest,- ServletRequest,- MultipartHttpServletRequest,- MultipartRequest
Default implementation of the
 
MultipartHttpServletRequest
 interface. Provides management of pre-generated parameter values.- Since:
- 29.09.2003
- Author:
- Trevor D. Cook, Juergen Hoeller, Arjen Poutsma
- See Also:
- 
Field SummaryFields inherited from interface jakarta.servlet.http.HttpServletRequestBASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
- 
Constructor SummaryConstructorsConstructorDescriptionWrap the given HttpServletRequest in a MultipartHttpServletRequest.DefaultMultipartHttpServletRequest(HttpServletRequest request, MultiValueMap<String, MultipartFile> mpFiles, Map<String, String[]> mpParams, Map<String, String> mpParamContentTypes) Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
- 
Method SummaryModifier and TypeMethodDescriptiongetMultipartContentType(String paramOrFileName) Determine the content type of the specified request part.getMultipartHeaders(String paramOrFileName) Return the headers for the specified part of the multipart request.Obtain the multipart parameter content type Map for retrieval, lazily initializing it if necessary.Obtain the multipart parameter Map for retrieval, lazily initializing it if necessary.getParameter(String name) String[]getParameterValues(String name) protected final voidsetMultipartParameterContentTypes(Map<String, String> multipartParameterContentTypes) Set a Map with parameter names as keys and content type Strings as values.protected final voidsetMultipartParameters(Map<String, String[]> multipartParameters) Set a Map with parameter names as keys and String array objects as values.Methods inherited from class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequestgetFile, getFileMap, getFileNames, getFiles, getMultiFileMap, getMultipartFiles, getRequest, getRequestHeaders, getRequestMethod, initializeMultipart, isResolved, setMultipartFilesMethods inherited from class jakarta.servlet.http.HttpServletRequestWrapperauthenticate, 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, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgradeMethods inherited from class jakarta.servlet.ServletRequestWrappergetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getProtocolRequestId, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsyncMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.http.HttpServletRequestauthenticate, 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, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgradeMethods inherited from interface jakarta.servlet.ServletRequestgetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getProtocolRequestId, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
- 
Constructor Details- 
DefaultMultipartHttpServletRequestpublic DefaultMultipartHttpServletRequest(HttpServletRequest request, MultiValueMap<String, MultipartFile> mpFiles, Map<String, String[]> mpParams, Map<String, String> mpParamContentTypes) Wrap the given HttpServletRequest in a MultipartHttpServletRequest.- Parameters:
- request- the servlet request to wrap
- mpFiles- a map of the multipart files
- mpParams- a map of the parameters to expose, with Strings as keys and String arrays as values
 
- 
DefaultMultipartHttpServletRequestWrap the given HttpServletRequest in a MultipartHttpServletRequest.- Parameters:
- request- the servlet request to wrap
 
 
- 
- 
Method Details- 
getParameter- Specified by:
- getParameterin interface- ServletRequest
- Overrides:
- getParameterin class- ServletRequestWrapper
 
- 
getParameterValues- Specified by:
- getParameterValuesin interface- ServletRequest
- Overrides:
- getParameterValuesin class- ServletRequestWrapper
 
- 
getParameterNames- Specified by:
- getParameterNamesin interface- ServletRequest
- Overrides:
- getParameterNamesin class- ServletRequestWrapper
 
- 
getParameterMap- Specified by:
- getParameterMapin interface- ServletRequest
- Overrides:
- getParameterMapin class- ServletRequestWrapper
 
- 
getMultipartContentTypeDescription copied from interface:MultipartRequestDetermine the content type of the specified request part.- Parameters:
- paramOrFileName- the name of the part
- Returns:
- the associated content type, or nullif not defined
 
- 
getMultipartHeadersDescription copied from interface:MultipartHttpServletRequestReturn the headers for the specified part of the multipart request.If the underlying implementation supports access to part headers, then all headers are returned. Otherwise, e.g. for a file upload, the returned headers may expose a 'Content-Type' if available. 
- 
setMultipartParametersSet a Map with parameter names as keys and String array objects as values. To be invoked by subclasses on initialization.
- 
getMultipartParametersObtain the multipart parameter Map for retrieval, lazily initializing it if necessary.
- 
setMultipartParameterContentTypesprotected final void setMultipartParameterContentTypes(Map<String, String> multipartParameterContentTypes) Set a Map with parameter names as keys and content type Strings as values. To be invoked by subclasses on initialization.
- 
getMultipartParameterContentTypesObtain the multipart parameter content type Map for retrieval, lazily initializing it if necessary.
 
-