cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1103807 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Date Mon, 16 May 2011 17:24:21 GMT
Author: dkulp
Date: Mon May 16 17:24:21 2011
New Revision: 1103807

URL: http://svn.apache.org/viewvc?rev=1103807&view=rev
Log:
[CXF-3472] Make it even easier to extend the HTTPConduit by moving the
creation of the OutputStream into a protected method

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1103807&r1=1103806&r2=1103807&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Mon May 16 17:24:21 2011
@@ -536,17 +536,26 @@ public class HTTPConduit 
 
         setHeadersByAuthorizationPolicy(message, currentURL);
         new Headers(message).setFromClientPolicy(getClient(message));
-
         message.setContent(OutputStream.class, 
-                           new WrappedOutputStream(
-                                   message, connection,
-                                   needToCacheRequest, 
-                                   isChunking,
-                                   chunkThreshold,
-                                   getConduitName()));
+                           createOutputStream(message, connection,
+                                              needToCacheRequest, 
+                                              isChunking,
+                                              chunkThreshold));
         // We are now "ready" to "send" the message. 
     }
 
+    protected OutputStream createOutputStream(Message message, 
+                                              HttpURLConnection connection,
+                                              boolean needToCacheRequest, 
+                                              boolean isChunking,
+                                              int chunkThreshold) {
+        return new WrappedOutputStream(message, connection,
+                                       needToCacheRequest, 
+                                       isChunking,
+                                       chunkThreshold,
+                                       getConduitName());
+    }
+
     private HttpAuthSupplier createAuthSupplier(String authType) {
         if (HttpAuthHeader.AUTH_TYPE_NEGOTIATE.equals(authType)) {
             return new SpnegoAuthSupplier();



Mime
View raw message