类 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
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
delete()
String
getContentType()
String
getHeader(String name)
Collection<String>
getHeaderNames()
HttpHeaders
getHeaders()
Return theHttpHeaders
backing header related accessor methods, allowing for populating selected header entries.Collection<String>
getHeaders(String name)
InputStream
getInputStream()
String
getName()
long
getSize()
String
getSubmittedFileName()
void
write(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 theHttpHeaders
backing header related accessor methods, allowing for populating selected header entries.