类 MockPart
- java.lang.Object
- org.springframework.mock.web.MockPart
- 所有已实现的接口:
Part
public class MockPart extends Object implements Part
Mock implementation ofjavax.servlet.http.Part.- 从以下版本开始:
- 4.3.12
- 作者:
- Rossen Stoyanchev, Juergen Hoeller
- 另请参阅:
MockHttpServletRequest.addPart(javax.servlet.http.Part),MockMultipartFile
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voiddelete()StringgetContentType()StringgetHeader(String name)Collection<String>getHeaderNames()HttpHeadersgetHeaders()Return theHttpHeadersbacking header related accessor methods, allowing for populating selected header entries.Collection<String>getHeaders(String name)InputStreamgetInputStream()StringgetName()longgetSize()StringgetSubmittedFileName()voidwrite(String fileName)
构造器详细资料
MockPart
public MockPart(String name, byte[] content)
Constructor for a part with byte[] content only.- 另请参阅:
getHeaders()
MockPart
public MockPart(String name, String filename, byte[] content)
Constructor for a part with a filename and byte[] content.- 另请参阅:
getHeaders()
方法详细资料
getSubmittedFileName
public String getSubmittedFileName()
- 指定者:
getSubmittedFileName在接口中Part
getContentType
public String getContentType()
- 指定者:
getContentType在接口中Part
getInputStream
public InputStream getInputStream() throws IOException
- 指定者:
getInputStream在接口中Part- 抛出:
IOException
write
public void write(String fileName) throws IOException
- 指定者:
write在接口中Part- 抛出:
IOException
delete
public void delete() throws IOException
- 指定者:
delete在接口中Part- 抛出:
IOException
getHeaders
public Collection<String> getHeaders(String name)
- 指定者:
getHeaders在接口中Part
getHeaderNames
public Collection<String> getHeaderNames()
- 指定者:
getHeaderNames在接口中Part
getHeaders
public final HttpHeaders getHeaders()
Return theHttpHeadersbacking header related accessor methods, allowing for populating selected header entries.