camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r719854 - in /activemq/camel/branches/camel-1.x: ./ components/camel-http/src/main/java/org/apache/camel/component/http/ components/camel-jetty/src/test/java/org/apache/camel/component/jetty/
Date Sat, 22 Nov 2008 14:22:22 GMT
Author: ningjiang
Date: Sat Nov 22 06:22:22 2008
New Revision: 719854

URL: http://svn.apache.org/viewvc?rev=719854&view=rev
Log:
Merged revisions 719848 via svnmerge from 
https://svn.apache.org/repos/asf/activemq/camel/trunk

........
  r719848 | ningjiang | 2008-11-22 21:32:46 +0800 (Sat, 22 Nov 2008) | 1 line
  
  Fixed the camel-jetty and camel-http CS errors
........

Modified:
    activemq/camel/branches/camel-1.x/   (props changed)
    activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpBinding.java
    activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpOperationFailedException.java
    activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
    activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpBindingRefTest.java
    activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpClientOptionsTest.java
    activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyResponseBodyWhenErrorTest.java
  (props changed)

Propchange: activemq/camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Nov 22 06:22:22 2008
@@ -1 +1 @@
-/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713136,713273,713290,713292,713295,713314,713475,713625,713932,713944,714032,717965,717989,718242,718273,718312-718515,719163-719184,719334,719339,719524,719662
+/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713136,713273,713290,713292,713295,713314,713475,713625,713932,713944,714032,717965,717989,718242,718273,718312-718515,719163-719184,719334,719339,719524,719662,719848

Propchange: activemq/camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpBinding.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpBinding.java?rev=719854&r1=719853&r2=719854&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpBinding.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpBinding.java
Sat Nov 22 06:22:22 2008
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.component.http;
 
 import java.io.IOException;

Modified: activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpOperationFailedException.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpOperationFailedException.java?rev=719854&r1=719853&r2=719854&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpOperationFailedException.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpOperationFailedException.java
Sat Nov 22 06:22:22 2008
@@ -22,21 +22,22 @@
 import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.httpclient.StatusLine;
 
-public class HttpOperationFailedException extends CamelException {
+public class HttpOperationFailedException extends CamelException {    
     private final String redirectLocation;
     private final int statusCode;
     private final StatusLine statusLine;
-    private InputStream responseBody;
+    private final InputStream responseBody;
 
-    public HttpOperationFailedException(int statusCode, StatusLine statusLine, String location)
{
+    public HttpOperationFailedException(int statusCode, StatusLine statusLine, String location,
InputStream responseBody) {
         super("HTTP operation failed with statusCode: " + statusCode + ", status: " + statusLine
+ (location != null ? ", redirectLocation: " + location : ""));
         this.statusCode = statusCode;
         this.statusLine = statusLine;
         this.redirectLocation = location;
+        this.responseBody = responseBody;
     }
 
-    public HttpOperationFailedException(int statusCode, StatusLine statusLine) {
-        this(statusCode, statusLine, null);
+    public HttpOperationFailedException(int statusCode, StatusLine statusLine, InputStream
responseBody) {
+        this(statusCode, statusLine, null, responseBody);
     }
 
     public boolean isRedirectError() {
@@ -63,7 +64,5 @@
         return responseBody;
     }
 
-    public void setResponseBody(InputStream responseBody) {
-        this.responseBody = responseBody;
-    }
+   
 }
\ No newline at end of file

Modified: activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java?rev=719854&r1=719853&r2=719854&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
Sat Nov 22 06:22:22 2008
@@ -104,24 +104,23 @@
                 }
             } else {
                 HttpOperationFailedException exception = null;
+                InputStream is =  extractResponseBody(method);
                 if (responseCode >= 300 && responseCode < 400) {
                     String redirectLocation;
                     Header locationHeader = method.getResponseHeader("location");
                     if (locationHeader != null) {
                         redirectLocation = locationHeader.getValue();
-                        exception = new HttpOperationFailedException(responseCode, method.getStatusLine(),
redirectLocation);
+                        exception = new HttpOperationFailedException(responseCode, method.getStatusLine(),
redirectLocation, is);
                     } else {
                         // no redirect location
-                        exception = new HttpOperationFailedException(responseCode, method.getStatusLine());
+                        exception = new HttpOperationFailedException(responseCode, method.getStatusLine(),
is);
                     }
                 } else {
                     // internal server error (error code 500)
-                    exception = new HttpOperationFailedException(responseCode, method.getStatusLine());
+                    exception = new HttpOperationFailedException(responseCode, method.getStatusLine(),
is);
                 }
 
-                if (exception != null) {
-                    // set also the response body as well
-                    exception.setResponseBody(extractResponseBody(method));
+                if (exception != null) {                    
                     throw exception;
                 }
             }

Modified: activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpBindingRefTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpBindingRefTest.java?rev=719854&r1=719853&r2=719854&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpBindingRefTest.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpBindingRefTest.java
Sat Nov 22 06:22:22 2008
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.component.jetty;
 
 import java.io.IOException;

Modified: activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpClientOptionsTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpClientOptionsTest.java?rev=719854&r1=719853&r2=719854&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpClientOptionsTest.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpClientOptionsTest.java
Sat Nov 22 06:22:22 2008
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.component.jetty;
 
 import org.apache.camel.ContextTestSupport;

Propchange: activemq/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyResponseBodyWhenErrorTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Nov 22 06:22:22 2008
@@ -0,0 +1 @@
+/activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyResponseBodyWhenErrorTest.java:719848



Mime
View raw message