camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [4/4] camel git commit: Camel catalog - Fixed endpoint properties parser.
Date Fri, 08 Jan 2016 12:44:11 GMT
Camel catalog - Fixed endpoint properties parser.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8466cc24
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8466cc24
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8466cc24

Branch: refs/heads/camel-2.16.x
Commit: 8466cc24511ed117934cdd0cef96d3e1c6990eec
Parents: 245e14e
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Jan 8 13:35:47 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Jan 8 13:43:58 2016 +0100

----------------------------------------------------------------------
 .../component/netty/http/NettyHttpConfiguration.java   |  2 +-
 .../component/netty4/http/NettyHttpConfiguration.java  |  2 +-
 .../org/apache/camel/catalog/DefaultCamelCatalog.java  | 13 ++++++++++++-
 3 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8466cc24/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
index 641f16f..05999d3 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
@@ -40,7 +40,7 @@ public class NettyHttpConfiguration extends NettyConfiguration {
     private String host;
     @UriPath
     private int port;
-    @UriPath @Metadata(required = "true")
+    @UriPath
     private String path;
     @UriParam(label = "consumer,advanced")
     private boolean urlDecodeHeaders;

http://git-wip-us.apache.org/repos/asf/camel/blob/8466cc24/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
index d9bbbbb..9f6c9bb 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
@@ -39,7 +39,7 @@ public class NettyHttpConfiguration extends NettyConfiguration {
     private String host;
     @UriPath
     private int port;
-    @UriPath @Metadata(required = "true")
+    @UriPath
     private String path;
     @UriParam(label = "consumer,advanced")
     private boolean urlDecodeHeaders;

http://git-wip-us.apache.org/repos/asf/camel/blob/8466cc24/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
b/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
index 14a4d50..ae955d6 100644
--- a/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
+++ b/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
@@ -1102,7 +1102,18 @@ public class DefaultCamelCatalog implements CamelCatalog {
             } else {
                 // we have a little problem as we do not not have all options
                 if (!required) {
-                    String value = defaultValue;
+                    String value = null;
+
+                    boolean last = i == word.size() - 1;
+                    if (last) {
+                        // if its the last value then use it instead of the default value
+                        value = it.hasNext() ? it.next() : null;
+                        if (value != null) {
+                            options.put(key, value);
+                        } else {
+                            value = defaultValue;
+                        }
+                    }
                     if (value != null) {
                         options.put(key, value);
                         defaultValueAdded = true;


Mime
View raw message