cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1509762 - in /cxf/branches/2.7.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
Date Fri, 02 Aug 2013 16:22:45 GMT
Author: sergeyb
Date: Fri Aug  2 16:22:45 2013
New Revision: 1509762

URL: http://svn.apache.org/r1509762
Log:
Merged revisions 1509756 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1509756 | sergeyb | 2013-08-02 17:10:36 +0100 (Fri, 02 Aug 2013) | 1 line
  
  [CXF-5144] Closing response stream only if 'response.stream.auto.close' property is enabled
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1509756

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java?rev=1509762&r1=1509761&r2=1509762&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
Fri Aug  2 16:22:45 2013
@@ -509,7 +509,7 @@ public abstract class AbstractClient imp
             } catch (Exception ex) {
                 reportMessageHandlerProblem("MSG_READER_PROBLEM", cls, contentType, ex, r);
             } finally {
-                if (cls != InputStream.class && inputStream != null) {
+                if (inputStream != null && responseStreamCanBeClosed(outMessage,
cls)) {
                     try {
                         inputStream.close();
                     } catch (IOException ex) { 
@@ -523,6 +523,10 @@ public abstract class AbstractClient imp
         return null;                                                
     }
     
+    private boolean responseStreamCanBeClosed(Message outMessage, Class<?> cls) {
+        return MessageUtils.isTrue(outMessage.getContextualProperty("response.stream.auto.close"));
+    }    
+
     protected void completeExchange(Object response, Exchange exchange, boolean proxy) {
         // higher level conduits such as FailoverTargetSelector need to
         // clear the request state but a fair number of response objects 



Mime
View raw message