Martin Holz wrote:
> there is a serious bug in NodeRevisionContent.
>
> The stream returned by NodesRevisionContent.streamContent() should be used
> only once, if the was set in NodeRevisionContent.setContent(InputStream
> inputStream)
>
>  However it will be used more often:
>
> 1) in most implementations of ContentInterceptor.preStoreContent
> 2) when storeing the content
> 3) in most implementations of ContentInterceptor.postStoreContent

[...]


> Unless the concept of ContentInterceptos is cancelled, the
> NodeRevisionContent must keep a copy of the content.
>
> I have attached a patch, which fixes the bug at the price of lower  speed
> and higher memory consumption.

My new version of NodeRevisionContent  will not work if
you are using code like this:

===  From  slidestore.reference.FileContentStore ====

FileInputStream is = new FileInputStream(file);
InputStreamReader reader = new InputStreamReader
                (is, CHARACTER_ENCODING);
result = new NodeRevisionContent();
result.setContent(reader);
result.setContent(is);
===========================================

Can someone explain me, how NodeRevisionContent should work? 
Either FileContentStore or the usage with ContentInterceptor is completely 
broken.

Martin

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to