Open wingyiu opened 5 years ago
like pipeline uploading to aws
@defnull while it can be implemented that way, for example the headers are available at the point where the write of the file starts I would see a use case for just having the headers in a more abstract part of the application. Given that the custom PartBodyStreamStorageFactory can be initialised with any context that the application can possible ask for it can't be initialised with values it does not know. For example if I would have two parts one is some identifier and one in the file contents, the parsed contents of part 1 would not be available in part 2. In order to provide such information for the to be uploaded bucket more context should be available in newStreamStorageForPartBody. My own use case would be passing the temporary filename to the rest of the application for monitoring. I am currently setting this filename to something the rest of the application is aware of.
I'd just let my NioMultipartParserListener
also implement PartBodyStreamStorageFactory
, or share the important state between both instances in some other way. Then you'd have all context you could ask for when newStreamStorageForPartBody
is called.
any possible?