On Jun 2, 2009, at 11:44 PM, Ari Heino wrote:
>
>
>
> Paul Sandoz wrote:
>>
>>
>> If you want to stream the body part (which will be cached to disk)
>> you
>> need to do:
>>
>> InputStream in =
>> multiPart.getBodyParts().get(1).getEntityAs(InputStream.class);
>>
>>
>
> So if i pass on this Stream to other components, does it actually
> contain
> anything?
Yes, one can read the bytes of the MIME body.
> Like you said, MimePull needs to be "used" inside Jersey resource
> class, otherwise stream.available() == 0.
Correct, one should not use that to assume that the stream is empty.
> So that means that the stream
> needs to be read into memory while process/thread is still in jersey
> resource, right? Or is the content available elsewhere also, since
> it is
> cached to disk?
The latter, MimePull will automatically cache all the attachments to
disk. It is possible to configure the size at which caching is
performed.
Paul.