You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2017/03/24 15:49:41 UTC

[jira] [Updated] (CXF-6544) OutputStream#close not called for WriterInterceptor

     [ https://issues.apache.org/jira/browse/CXF-6544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-6544:
-----------------------------
    Component/s: JAX-RS

> OutputStream#close not called for WriterInterceptor
> ---------------------------------------------------
>
>                 Key: CXF-6544
>                 URL: https://issues.apache.org/jira/browse/CXF-6544
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>            Reporter: Romain Manni-Bucau
>
> Hi
> close() is called later in the JAXRS client lifecycle so no way to add code properly at this moment:
> {code}
> ClientBuilder.newBuilder()
>                 .build()
>                 .register(new WriterInterceptor() {
>                     @Override
>                     public void aroundWriteTo(final WriterInterceptorContext writerInterceptorContext) throws IOException, WebApplicationException {
>                         writerInterceptorContext.setOutputStream(new FilterOutputStream(writerInterceptorContext.getOutputStream()) {
>                             @Override
>                             public void close() throws IOException {
>                                 // need code here
>                                 super.close();
>                             }
>                         });
>                     }
>                 })
> {code}
> Overall idea can need more work since i'd like to be able to add a final trailer to a HTTP chunk communication.
> Managed to do it with httpclient but I'd like to stick to JAXRS 2 if possible.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)