Repository: camel Updated Branches: refs/heads/camel-2.17.x 1f7b09fb7 -> 38a6966ad
Revert "Corrected formatting issues" This reverts commit 1f7b09fb7205593fc6fa8d2450a701bb053b7da5. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/91483f7c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/91483f7c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/91483f7c Branch: refs/heads/camel-2.17.x Commit: 91483f7c40a606e989ef6c55db42872645b8099e Parents: 1f7b09f Author: Andrea Cosentino <anco...@gmail.com> Authored: Thu Mar 23 10:47:23 2017 +0100 Committer: Andrea Cosentino <anco...@gmail.com> Committed: Thu Mar 23 10:47:23 2017 +0100 ---------------------------------------------------------------------- .../camel/component/jetty/JettyHttpProducer.java | 4 ++-- .../jetty9/CamelInputStreamContentProvider.java | 19 ++----------------- .../component/jetty9/JettyContentExchange9.java | 7 ++++--- 3 files changed, 8 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/91483f7c/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpProducer.java b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpProducer.java index e420b08..ee6b83b 100644 --- a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpProducer.java +++ b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpProducer.java @@ -164,7 +164,7 @@ public class JettyHttpProducer extends DefaultAsyncProducer implements AsyncProc String charset = IOHelper.getCharsetName(exchange, false); httpExchange.setRequestContent(data, charset); } else { - // then fallback to input stream + // then fallback to input stream InputStream is = exchange.getContext().getTypeConverter().mandatoryConvertTo(InputStream.class, exchange, exchange.getIn().getBody()); // setup the content length if it is possible String length = exchange.getIn().getHeader(Exchange.CONTENT_LENGTH, String.class); @@ -174,7 +174,7 @@ public class JettyHttpProducer extends DefaultAsyncProducer implements AsyncProc httpExchange.setRequestContent(is, new Integer(length)); } else { - //send chunked + //send chunked httpExchange.setRequestContent(is); } } http://git-wip-us.apache.org/repos/asf/camel/blob/91483f7c/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/CamelInputStreamContentProvider.java ---------------------------------------------------------------------- diff --git a/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/CamelInputStreamContentProvider.java b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/CamelInputStreamContentProvider.java index 629a5a1..08d66c6 100644 --- a/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/CamelInputStreamContentProvider.java +++ b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/CamelInputStreamContentProvider.java @@ -1,19 +1,3 @@ -/** - * 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.jetty9; import java.io.InputStream; @@ -30,7 +14,8 @@ public class CamelInputStreamContentProvider extends InputStreamContentProvider } @Override - public long getLength() { + public long getLength() + { return length; } } http://git-wip-us.apache.org/repos/asf/camel/blob/91483f7c/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/JettyContentExchange9.java ---------------------------------------------------------------------- diff --git a/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/JettyContentExchange9.java b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/JettyContentExchange9.java index b64bca0..d1eaab0 100644 --- a/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/JettyContentExchange9.java +++ b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/JettyContentExchange9.java @@ -195,9 +195,10 @@ public class JettyContentExchange9 implements JettyContentExchange { this.request.content(new InputStreamContentProvider(ins), this.requestContentType); } - public void setRequestContent(InputStream ins, int contentLength) { - this.request.content(new CamelInputStreamContentProvider(ins, contentLength), this.requestContentType); - } + public void setRequestContent(InputStream ins, int contentLength) { + this.request.content(new CamelInputStreamContentProvider(ins, contentLength), this.requestContentType); + + } public void addRequestHeader(String key, String s) { this.request.header(key, s);