[ 
https://issues.apache.org/jira/browse/TRINIDAD-1757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845528#action_12845528
 ] 

Matthias Weßendorf commented on TRINIDAD-1757:
----------------------------------------------

The "trick"y part is the handling of the input stream (its buffering)
However, it is kinda odd that the JavaDoc says "getInputStream" can be called 
repeatedly,
since the processFile() takes an _internal_ impl of the UploadedFile. This guy 
does not allow
getInputStream() called repeatedly so a customer could be confused here.. 
That's why we
need some buffer/byte-array...

The implementation of the passed in UploadedFile points to the IMPL-specific 
MultipartFormItem interface implementation:
==> MultipartFormItemImpl

Its writeFile/getInputStream() check if they have been called (and cause the 
trouble).
So here we need to introduce the buffer. 

> Allow (or support) decorator pattern for the UploadedFileProcessor
> ------------------------------------------------------------------
>
>                 Key: TRINIDAD-1757
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1757
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Matthias Weßendorf
>
> Currently it is only possible to replace the entire UploadedFileProcessor, 
> with a custom one.
> A neat improvement (crap, this should not be a bug) would be supporting the 
> decorator pattern.
> The tricky part is that we need a buffer inside of the implementation of the 
> file
> that get's passed into the Processor.
> currently you can call only once the "getInputStream", so we need a buffer 
> here
> (that works with the impl's writeFile()/getInputStream()):
> There are some ways for that. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to