Currently, MultipartFileResource class is package-private, but it is quite handy in some situations as end user.
For example., when having a Multipart Controller that forwards the payload to another Controller, wrapping the MultiPartFIle into a MultipartFileResource is quite handy, since we don't need to deal with the setting of the filename, the length or the mediatype, and it fits absolutely nicely when using new contentRequestMatchers.multipartData()
Comment From: jhoeller
Couldn't you call MultipartFile.getResource()
instead of trying to refer to the resource implementation class directly? We should make that more obvious, in any case...
Comment From: nightswimmings
Wow, I am stupid! Thanks!!!!
Comment From: jhoeller
No worries, I'll add a javadoc reference from MultipartFileResource
back to MultipartFile.getResource()
so that this becomes more obvious for the casual source code reader...