zberentey/liferay-plugins — pull request #11 by danielreuther (2013-01-07 13:32:39+00:00)
Title: [TECH SUPPORT] LPS-31916

Hi Zsolt,

This is a tricky one. When we're downloading an app via the Market Place portlet, we're directly passing on the stream of it to the DL store. This HttpInputStream, however, will return 'true' when asked whether it supports marks or not—but when trying to reset it, you won't get any more data out of it. Which means that the antivirus check will exhaust the stream before it has a chance to be actually persisted to the store.

There are a felt thousand solutions to this, one of them being to wrap the stream with one that return false; but that felt rather unclean (I'd actually love to hear your opinion on that one): https://github.com/danielreuther/liferay-plugins/commit/14094b07d92b4f0665ca7a3a1d29b7132ce2c7b6

So, I decided to just pass an actual file to the DL store.

Please let me know if you have any questions about this...

Thanks,
Daniel