You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@wink.apache.org by Murali <up...@us.ibm.com> on 2010/11/23 16:17:21 UTC

Cannot instantiate the type OutMultiPart

Hi,

I have to produce a multipart message, and I am using Apache Wink Multipart
data Model.

I am not able to create a new instance of OutMultipart class. When I type in
"new OutMultipart()" it says "Cannot instantiate the type OutMultiPart".

I am able to use BufferedOutMultiPart with success. But, I want to stream
the data instead of buffereing the data, as my data might be large.

http://apache-wink-users.3471013.n2.nabble.com/file/n5766774/untitled.jpg 

Thanks in advance,

Murali Uppala 
-- 
View this message in context: http://apache-wink-users.3471013.n2.nabble.com/Cannot-instantiate-the-type-OutMultiPart-tp5766774p5766774.html
Sent from the Apache Wink Users mailing list archive at Nabble.com.

Re: Cannot instantiate the type OutMultiPart

Posted by Bryant Luk <br...@gmail.com>.
OutMultiPart is an abstract class that provides a basic implementation
of some of the methods for a multipart representation.

You need to implement

 protected abstract Iterator<? extends OutPart> getIterator();

The JavaDoc explains a bit more but you essentially need to give back
an iterator of OutParts which contain the actual bodies.  The
OutPart.setBody() should be able to take an InputStream as a "body"
object which you can use to stream your part out.

On Tue, Nov 23, 2010 at 9:17 AM, Murali <up...@us.ibm.com> wrote:
>
> Hi,
>
> I have to produce a multipart message, and I am using Apache Wink Multipart
> data Model.
>
> I am not able to create a new instance of OutMultipart class. When I type in
> "new OutMultipart()" it says "Cannot instantiate the type OutMultiPart".
>
> I am able to use BufferedOutMultiPart with success. But, I want to stream
> the data instead of buffereing the data, as my data might be large.
>
> http://apache-wink-users.3471013.n2.nabble.com/file/n5766774/untitled.jpg
>
> Thanks in advance,
>
> Murali Uppala
> --
> View this message in context: http://apache-wink-users.3471013.n2.nabble.com/Cannot-instantiate-the-type-OutMultiPart-tp5766774p5766774.html
> Sent from the Apache Wink Users mailing list archive at Nabble.com.
>