Which Attachment constructor you are using ?
I've looked at the code, the treatment of the 'object' property is a bit
inconsistent on the client side, it was added mainly for the server code
when you can do
InputStream is = attachment.getObject(InputStream.class);
or, read InputStream into a custom object like Book with the registered
providers:
Book is = attachment.getObject(Book.class);
etc
On the client side 'object' and 'dataHandler' properties are the same,
but I see one constructor not initializing 'object' - 'object' is never
used on the client side to get the attachment processed.
Work with attachment.getDataHandler(), or if you have an access to the
code which creates these attachments then simply close InputStream from
that code...
Sergey
On 12/09/16 23:43, Adam Decatur wrote:
Awesome, thank you! As I am looping over each attachment in the multipart
is there an easy to determine which ones are an InputStream? The following
doesn't seem to work.
Object obj = attachment.getObject();
if (obj instanceof InputStream)
{
...
}
-----Original Message-----
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: Monday, September 12, 2016 3:49 PM
To: d...@cxf.apache.org; users
Subject: Re: Question - Who closes the InputStream?
Yes, and if you use the async invoker then I guess you can close it
immediately after a reference to a Future is returned
Sergey
On 12/09/16 21:46, Adam Decatur wrote:
Yes, I am referring to client-side code. Cool, so I have get a
response back from the Web service I should go ahead and close the stream?
-----Original Message-----
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: Monday, September 12, 2016 3:41 PM
To: users
Cc: Daniel Kulp
Subject: Re: Question - Who closes the InputStream?
Hi
Thanks for this question, forwarding to the users.
Are you referring to the client side code ? If yes then indeed your
code should close the streams once a call doing the upload returns.
Cheers, Sergey
On 12/09/16 21:31, Adam Decatur wrote:
Hello,
I am developing a Maven JAR in Eclipse that posts a Multipart to a
rest-based web-service. The multipart contains 2 or more Attachments.
The Attachments are being constructed with an InputStream. Do I need
to take care of closing these InputStreams? Or does CXF Apache do
this for me?
Thank you,
Adam
*Adam Decatur*
Enterprise Software
*O* +1 913 227 1812**
*M* +1 330 506 0610**
adam.deca...@lexmark.com <mailto:adam.deca...@lexmark.com>
http://www.lexmark.com/common/images/email/lexmark-logo-email-signatu
r
e.png
<http://www.lexmark.com/>
www.lexmark.com <http://www.lexmark.com>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/