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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
final HttpHeaders
Return theHttpHeaders
backing header related accessor methods, allowing for populating selected header entries.getHeaders
(String name) getName()
long
getSize()
void
-
Constructor Details
-
MockPart
Constructor for a part with byte[] content only.- See Also:
-
MockPart
Constructor for a part with a filename and byte[] content.- See Also:
-
-
Method Details
-
getName
-
getSubmittedFileName
- Specified by:
getSubmittedFileName
in interfacePart
-
getContentType
- Specified by:
getContentType
in interfacePart
-
getSize
public long getSize() -
getInputStream
- Specified by:
getInputStream
in interfacePart
- Throws:
IOException
-
write
- Specified by:
write
in interfacePart
- Throws:
IOException
-
delete
- Specified by:
delete
in interfacePart
- Throws:
IOException
-
getHeader
-
getHeaders
- Specified by:
getHeaders
in interfacePart
-
getHeaderNames
- Specified by:
getHeaderNames
in interfacePart
-
getHeaders
Return theHttpHeaders
backing header related accessor methods, allowing for populating selected header entries.
-