类 RequestPartServletServerHttpRequest
- java.lang.Object
- org.springframework.http.server.ServletServerHttpRequest
- org.springframework.web.multipart.support.RequestPartServletServerHttpRequest
- 所有已实现的接口:
HttpInputMessage
,HttpMessage
,HttpRequest
,ServerHttpRequest
public class RequestPartServletServerHttpRequest extends ServletServerHttpRequest
ServerHttpRequest
implementation that accesses one part of a multipart request. If usingMultipartResolver
configuration the part is accessed through aMultipartFile
. Or if using Servlet 3.0 multipart processing the part is accessed throughServletRequest.getPart
.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev, Juergen Hoeller
字段概要
从类继承的字段 org.springframework.http.server.ServletServerHttpRequest
FORM_CHARSET, FORM_CONTENT_TYPE
构造器概要
构造器 构造器 说明 RequestPartServletServerHttpRequest(HttpServletRequest request, String requestPartName)
Create a newRequestPartServletServerHttpRequest
instance.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 InputStream
getBody()
Return the body of the message as an input stream.HttpHeaders
getHeaders()
Return the headers of this message.从类继承的方法 org.springframework.http.server.ServletServerHttpRequest
getAsyncRequestControl, getLocalAddress, getMethod, getPrincipal, getRemoteAddress, getServletRequest, getURI
构造器详细资料
RequestPartServletServerHttpRequest
public RequestPartServletServerHttpRequest(HttpServletRequest request, String requestPartName) throws MissingServletRequestPartException
Create a newRequestPartServletServerHttpRequest
instance.- 参数:
request
- the current servlet requestrequestPartName
- the name of the part to adapt to theServerHttpRequest
contract- 抛出:
MissingServletRequestPartException
- if the request part cannot be foundMultipartException
- if MultipartHttpServletRequest cannot be initialized
方法详细资料
getHeaders
public HttpHeaders getHeaders()
从接口复制的说明:HttpMessage
Return the headers of this message.- 指定者:
getHeaders
在接口中HttpMessage
- 覆盖:
getHeaders
在类中ServletServerHttpRequest
- 返回:
- a corresponding HttpHeaders object (never
null
)
getBody
public InputStream getBody() throws IOException
从接口复制的说明:HttpInputMessage
Return the body of the message as an input stream.- 指定者:
getBody
在接口中HttpInputMessage
- 覆盖:
getBody
在类中ServletServerHttpRequest
- 返回:
- the input stream body (never
null
) - 抛出:
IOException
- in case of I/O errors