Class RequestPartServletServerHttpRequest
java.lang.Object
org.springframework.http.server.ServletServerHttpRequest
org.springframework.web.multipart.support.RequestPartServletServerHttpRequest
- All Implemented Interfaces:
HttpInputMessage
,HttpMessage
,HttpRequest
,ServerHttpRequest
ServerHttpRequest
implementation that accesses one part of a multipart
request. If using MultipartResolver
configuration the part is accessed
through a MultipartFile
. Or if using Servlet multipart processing
the part is accessed through ServletRequest.getPart
.- Since:
- 3.1
- Author:
- Rossen Stoyanchev, Juergen Hoeller
-
Field Summary
Fields inherited from class org.springframework.http.server.ServletServerHttpRequest
FORM_CHARSET
-
Constructor Summary
ConstructorDescriptionRequestPartServletServerHttpRequest
(HttpServletRequest request, String requestPartName) Create a newRequestPartServletServerHttpRequest
instance. -
Method Summary
Modifier and TypeMethodDescriptiongetBody()
Return the body of the message as an input stream.Return the headers of this message.Methods inherited from class org.springframework.http.server.ServletServerHttpRequest
getAsyncRequestControl, getLocalAddress, getMethod, getMethodValue, getPrincipal, getRemoteAddress, getServletRequest, getURI
-
Constructor Details
-
RequestPartServletServerHttpRequest
public RequestPartServletServerHttpRequest(HttpServletRequest request, String requestPartName) throws MissingServletRequestPartException Create a newRequestPartServletServerHttpRequest
instance.- Parameters:
request
- the current servlet requestrequestPartName
- the name of the part to adapt to theServerHttpRequest
contract- Throws:
MissingServletRequestPartException
- if the request part cannot be foundMultipartException
- if MultipartHttpServletRequest cannot be initialized
-
-
Method Details
-
getHeaders
Description copied from interface:HttpMessage
Return the headers of this message.- Specified by:
getHeaders
in interfaceHttpMessage
- Overrides:
getHeaders
in classServletServerHttpRequest
- Returns:
- a corresponding HttpHeaders object (never
null
)
-
getBody
Description copied from interface:HttpInputMessage
Return the body of the message as an input stream.- Specified by:
getBody
in interfaceHttpInputMessage
- Overrides:
getBody
in classServletServerHttpRequest
- Returns:
- the input stream body (never
null
) - Throws:
IOException
- in case of I/O errors
-