Package com.shri.restinpeace.mock
Class RecordedRequest.Part
java.lang.Object
com.shri.restinpeace.mock.RecordedRequest.Part
- Enclosing class:
- RecordedRequest
One part of a decoded
multipart/form-data request body, as
returned by RecordedRequest.getParts().-
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns this part's raw content bytes.Returns this part's content decoded as UTF-8, for a text part (a plainStringform field, or a text file).Returns this part'sContent-Type, if one was sent.Returns this part's file name, for aFile/byte[]/InputStreampart sent as a file.getName()Returns this part's name - the@Part'svalue, or the entry's key for a@PartMappart.
-
Method Details
-
getName
Returns this part's name - the@Part'svalue, or the entry's key for a@PartMappart.- Returns:
- the part name
-
getFileName
Returns this part's file name, for aFile/byte[]/InputStreampart sent as a file.- Returns:
- the file name, or
nullfor a plainStringform field
-
getContentType
Returns this part'sContent-Type, if one was sent.- Returns:
- the content type, or
nullif none was sent
-
getContent
public byte[] getContent()Returns this part's raw content bytes.- Returns:
- the content bytes
-
getContentAsString
Returns this part's content decoded as UTF-8, for a text part (a plainStringform field, or a text file).- Returns:
- the content as a UTF-8 string
-