Package org.springframework.mock.web
Class MockPart
java.lang.Object
org.springframework.mock.web.MockPart
- All Implemented Interfaces:
- Part
Mock implementation of 
jakarta.servlet.http.Part.- Since:
- 4.3.12
- Author:
- Rossen Stoyanchev, Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoiddelete()final HttpHeadersReturn theHttpHeadersbacking header related accessor methods, allowing for populating selected header entries.getHeaders(String name) getName()longgetSize()void
- 
Constructor Details- 
MockPartConstructor for a part with byte[] content only.- See Also:
 
- 
MockPartConstructor for a part with a filename and byte[] content.- See Also:
 
 
- 
- 
Method Details- 
getName
- 
getSubmittedFileName- Specified by:
- getSubmittedFileNamein interface- Part
 
- 
getContentType- Specified by:
- getContentTypein interface- Part
 
- 
getSizepublic long getSize()
- 
getInputStream- Specified by:
- getInputStreamin interface- Part
- Throws:
- IOException
 
- 
write- Specified by:
- writein interface- Part
- Throws:
- IOException
 
- 
delete- Specified by:
- deletein interface- Part
- Throws:
- IOException
 
- 
getHeader
- 
getHeaders- Specified by:
- getHeadersin interface- Part
 
- 
getHeaderNames- Specified by:
- getHeaderNamesin interface- Part
 
- 
getHeadersReturn theHttpHeadersbacking header related accessor methods, allowing for populating selected header entries.
 
-