You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/09/21 14:51:12 UTC
[1/4] git commit: CAMEL-7829 Fixed the CS errors of camel-olingo2-api
Repository: camel
Updated Branches:
refs/heads/camel-2.12.x bde9a447a -> 57b1099f4
refs/heads/camel-2.13.x 64aa22d6f -> 978011461
refs/heads/camel-2.14.x fa690a5de -> fc99a62fd
CAMEL-7829 Fixed the CS errors of camel-olingo2-api
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/57e2fa49
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/57e2fa49
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/57e2fa49
Branch: refs/heads/camel-2.14.x
Commit: 57e2fa4998f328fb5f53a19e61f80d6adb851cad
Parents: fa690a5
Author: Willem Jiang <wi...@gmail.com>
Authored: Sun Sep 21 19:38:50 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sun Sep 21 20:48:41 2014 +0800
----------------------------------------------------------------------
.../olingo2/api/impl/Olingo2AppImpl.java | 24 ++++++++++++--------
1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/57e2fa49/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/Olingo2AppImpl.java
----------------------------------------------------------------------
diff --git a/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/Olingo2AppImpl.java b/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/Olingo2AppImpl.java
index 2c41453..78ce007 100644
--- a/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/Olingo2AppImpl.java
+++ b/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/Olingo2AppImpl.java
@@ -485,28 +485,32 @@ public final class Olingo2AppImpl implements Olingo2App {
// get the response content as Map<String, Object>
final List<EdmProperty> complexPropertyPath = uriInfo.getPropertyPath();
final EdmProperty complexProperty = complexPropertyPath.get(complexPropertyPath.size() - 1);
- responseHandler.onResponse(
- (T) EntityProvider.readProperty(getContentType(), complexProperty,
- result.getEntity().getContent(),
- EntityProviderReadProperties.init().build()));
+ responseHandler.onResponse((T)EntityProvider.readProperty(getContentType(),
+ complexProperty, result
+ .getEntity()
+ .getContent(),
+ EntityProviderReadProperties
+ .init().build()));
break;
case URI7A:
// $links with 0..1 cardinality property
// get the response content as String
final EdmEntitySet targetLinkEntitySet = uriInfo.getTargetEntitySet();
- responseHandler.onResponse(
- (T) EntityProvider.readLink(getContentType(), targetLinkEntitySet,
- result.getEntity().getContent()));
+ responseHandler.onResponse((T)EntityProvider.readLink(getContentType(),
+ targetLinkEntitySet, result
+ .getEntity()
+ .getContent()));
break;
case URI7B:
// $links with * cardinality property
// get the response content as java.util.List<String>
final EdmEntitySet targetLinksEntitySet = uriInfo.getTargetEntitySet();
- responseHandler.onResponse(
- (T) EntityProvider.readLinks(getContentType(), targetLinksEntitySet,
- result.getEntity().getContent()));
+ responseHandler.onResponse((T)EntityProvider.readLinks(getContentType(),
+ targetLinksEntitySet,
+ result.getEntity()
+ .getContent()));
break;
case URI1:
[2/4] git commit: CAMEL-7842 Avoid using InputStreamEntity for byte[]
input
Posted by ni...@apache.org.
CAMEL-7842 Avoid using InputStreamEntity for byte[] input
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fc99a62f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fc99a62f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fc99a62f
Branch: refs/heads/camel-2.14.x
Commit: fc99a62fdbdfa2ee54c7c9584e80e92df4b2b322
Parents: 57e2fa4
Author: Willem Jiang <wi...@gmail.com>
Authored: Sun Sep 21 20:11:59 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sun Sep 21 20:49:33 2014 +0800
----------------------------------------------------------------------
.../org/apache/camel/component/http4/HttpEntityConverter.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/fc99a62f/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
index e88ceb5..8236da8 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
@@ -25,6 +25,8 @@ import org.apache.camel.Exchange;
import org.apache.camel.util.ExchangeHelper;
import org.apache.camel.util.GZIPHelper;
import org.apache.http.HttpEntity;
+import org.apache.http.entity.AbstractHttpEntity;
+import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.InputStreamEntity;
/**
@@ -77,14 +79,15 @@ public final class HttpEntityConverter {
}
private static HttpEntity asHttpEntity(byte[] data, Exchange exchange) throws Exception {
- InputStreamEntity entity;
+ AbstractHttpEntity entity;
if (exchange != null && !exchange.getProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.FALSE, Boolean.class)) {
String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);
InputStream stream = GZIPHelper.compressGzip(contentEncoding, data);
entity = new InputStreamEntity(stream, stream instanceof ByteArrayInputStream
? stream.available() != 0 ? stream.available() : -1 : -1);
} else {
- entity = new InputStreamEntity(new ByteArrayInputStream(data), data.length);
+ // create the Repeatable HttpEntity
+ entity = new ByteArrayEntity(data);
}
if (exchange != null) {
String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);
[4/4] git commit: CAMEL-7842 Avoid using InputStreamEntity for byte[]
input
Posted by ni...@apache.org.
CAMEL-7842 Avoid using InputStreamEntity for byte[] input
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/57b1099f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/57b1099f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/57b1099f
Branch: refs/heads/camel-2.12.x
Commit: 57b1099f4319083443338fd6d36c4a033f8561cb
Parents: bde9a44
Author: Willem Jiang <wi...@gmail.com>
Authored: Sun Sep 21 20:11:59 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sun Sep 21 20:50:36 2014 +0800
----------------------------------------------------------------------
.../org/apache/camel/component/http4/HttpEntityConverter.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/57b1099f/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
index e88ceb5..8236da8 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
@@ -25,6 +25,8 @@ import org.apache.camel.Exchange;
import org.apache.camel.util.ExchangeHelper;
import org.apache.camel.util.GZIPHelper;
import org.apache.http.HttpEntity;
+import org.apache.http.entity.AbstractHttpEntity;
+import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.InputStreamEntity;
/**
@@ -77,14 +79,15 @@ public final class HttpEntityConverter {
}
private static HttpEntity asHttpEntity(byte[] data, Exchange exchange) throws Exception {
- InputStreamEntity entity;
+ AbstractHttpEntity entity;
if (exchange != null && !exchange.getProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.FALSE, Boolean.class)) {
String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);
InputStream stream = GZIPHelper.compressGzip(contentEncoding, data);
entity = new InputStreamEntity(stream, stream instanceof ByteArrayInputStream
? stream.available() != 0 ? stream.available() : -1 : -1);
} else {
- entity = new InputStreamEntity(new ByteArrayInputStream(data), data.length);
+ // create the Repeatable HttpEntity
+ entity = new ByteArrayEntity(data);
}
if (exchange != null) {
String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);
[3/4] git commit: CAMEL-7842 Avoid using InputStreamEntity for byte[]
input
Posted by ni...@apache.org.
CAMEL-7842 Avoid using InputStreamEntity for byte[] input
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/97801146
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/97801146
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/97801146
Branch: refs/heads/camel-2.13.x
Commit: 978011461d929f96b185449c70fd8418baf7c786
Parents: 64aa22d
Author: Willem Jiang <wi...@gmail.com>
Authored: Sun Sep 21 20:11:59 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sun Sep 21 20:50:19 2014 +0800
----------------------------------------------------------------------
.../org/apache/camel/component/http4/HttpEntityConverter.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/97801146/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
index e88ceb5..8236da8 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEntityConverter.java
@@ -25,6 +25,8 @@ import org.apache.camel.Exchange;
import org.apache.camel.util.ExchangeHelper;
import org.apache.camel.util.GZIPHelper;
import org.apache.http.HttpEntity;
+import org.apache.http.entity.AbstractHttpEntity;
+import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.InputStreamEntity;
/**
@@ -77,14 +79,15 @@ public final class HttpEntityConverter {
}
private static HttpEntity asHttpEntity(byte[] data, Exchange exchange) throws Exception {
- InputStreamEntity entity;
+ AbstractHttpEntity entity;
if (exchange != null && !exchange.getProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.FALSE, Boolean.class)) {
String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);
InputStream stream = GZIPHelper.compressGzip(contentEncoding, data);
entity = new InputStreamEntity(stream, stream instanceof ByteArrayInputStream
? stream.available() != 0 ? stream.available() : -1 : -1);
} else {
- entity = new InputStreamEntity(new ByteArrayInputStream(data), data.length);
+ // create the Repeatable HttpEntity
+ entity = new ByteArrayEntity(data);
}
if (exchange != null) {
String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);