You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2013/09/28 13:45:44 UTC
[01/11] git commit: CAMEL-5771 IOHelper.getCharsetName() should
lookup CHARSET_NAME in headers if exchange property is not set
Updated Branches:
refs/heads/camel-2.11.x 45d537719 -> 499fb0319
refs/heads/camel-2.12.x 258e7d6b0 -> 1605177b1
refs/heads/master 542103e52 -> 8270ae3a0
CAMEL-5771 IOHelper.getCharsetName() should lookup CHARSET_NAME in headers if exchange property is not set
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9f47f318
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9f47f318
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9f47f318
Branch: refs/heads/master
Commit: 9f47f3182cd015c5246ec971d33d78e19ad2d39a
Parents: 88220b8
Author: Marco Zapletal <ma...@edistream.com>
Authored: Tue Sep 24 18:59:00 2013 +0200
Committer: Marco Zapletal <ma...@edistream.com>
Committed: Tue Sep 24 18:59:00 2013 +0200
----------------------------------------------------------------------
camel-core/src/main/java/org/apache/camel/util/IOHelper.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/9f47f318/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
index 001d1e4..78f75c9 100644
--- a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
@@ -417,7 +417,8 @@ public final class IOHelper {
}
/**
- * Gets the charset name if set as property {@link Exchange#CHARSET_NAME}.
+ * Gets the charset name if set as property or header {@link Exchange#CHARSET_NAME}.
+ * Notice: The lookup from the property has priority over the header
*
* @param exchange the exchange
* @param useDefault should we fallback and use JVM default charset if no property existed?
@@ -426,6 +427,9 @@ public final class IOHelper {
public static String getCharsetName(Exchange exchange, boolean useDefault) {
if (exchange != null) {
String charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
+ if (charsetName == null) {
+ charsetName = exchange.getIn().getHeader(Exchange.CHARSET_NAME, String.class);
+ }
if (charsetName != null) {
return IOHelper.normalizeCharset(charsetName);
}
[09/11] git commit: Upgrade to CXF 2.7.7
Posted by da...@apache.org.
Upgrade to CXF 2.7.7
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1605177b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1605177b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1605177b
Branch: refs/heads/camel-2.12.x
Commit: 1605177b1934d52adc3369614c6914c929d4fee9
Parents: 95912fc
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Sep 28 13:41:48 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Sep 28 13:44:36 2013 +0200
----------------------------------------------------------------------
parent/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/1605177b/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index e10e5b4..f38cc02 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -105,7 +105,7 @@
<commons-vfs2-version>2.0</commons-vfs2-version>
<concurrentlinkedhashmap.version>1.4</concurrentlinkedhashmap.version>
<cobertura-maven-plugin-version>2.5.2</cobertura-maven-plugin-version>
- <cxf-version>2.7.6</cxf-version>
+ <cxf-version>2.7.7</cxf-version>
<cxf-version-range>[2.6,2.9)</cxf-version-range>
<cxf-xjc-utils-version>2.6.2</cxf-xjc-utils-version>
<deltaspike-version>0.3-incubating</deltaspike-version>
[03/11] git commit: CAMEL-5771 IOHelper.getCharsetName() should
lookup CHARSET_NAME in headers if exchange property is not set
Posted by da...@apache.org.
CAMEL-5771 IOHelper.getCharsetName() should lookup CHARSET_NAME in headers if exchange property is not set
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e73ed4ce
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e73ed4ce
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e73ed4ce
Branch: refs/heads/master
Commit: e73ed4ce0ef9a4b57a2cb8176f9dd6ea779b80cd
Parents: 48e3d8d
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Sep 28 12:46:29 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Sep 28 12:50:33 2013 +0200
----------------------------------------------------------------------
.../org/apache/camel/converter/IOConverter.java | 2 +-
.../main/java/org/apache/camel/util/IOHelper.java | 12 ++++++++----
.../java/org/apache/camel/util/IOHelperTest.java | 16 ++++++++++++++++
3 files changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/e73ed4ce/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java b/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
index 8107b49..02995fa 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
@@ -428,7 +428,7 @@ public final class IOConverter {
}
/**
- * Gets the charset name if set as property {@link Exchange#CHARSET_NAME}.
+ * Gets the charset name if set as header or property {@link Exchange#CHARSET_NAME}.
*
* @param exchange the exchange
* @param useDefault should we fallback and use JVM default charset if no property existed?
http://git-wip-us.apache.org/repos/asf/camel/blob/e73ed4ce/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
index 78f75c9..efd8b56 100644
--- a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
@@ -412,13 +412,16 @@ public final class IOHelper {
}
}
+ /**
+ * @see #getCharsetName(org.apache.camel.Exchange, boolean)
+ */
public static String getCharsetName(Exchange exchange) {
return getCharsetName(exchange, true);
}
/**
- * Gets the charset name if set as property or header {@link Exchange#CHARSET_NAME}.
- * Notice: The lookup from the property has priority over the header
+ * Gets the charset name if set as header or property {@link Exchange#CHARSET_NAME}.
+ * <b>Notice:</b> The lookup from the header has priority over the property.
*
* @param exchange the exchange
* @param useDefault should we fallback and use JVM default charset if no property existed?
@@ -426,9 +429,10 @@ public final class IOHelper {
*/
public static String getCharsetName(Exchange exchange, boolean useDefault) {
if (exchange != null) {
- String charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
+ // header takes precedence
+ String charsetName = exchange.getIn().getHeader(Exchange.CHARSET_NAME, String.class);
if (charsetName == null) {
- charsetName = exchange.getIn().getHeader(Exchange.CHARSET_NAME, String.class);
+ charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
}
if (charsetName != null) {
return IOHelper.normalizeCharset(charsetName);
http://git-wip-us.apache.org/repos/asf/camel/blob/e73ed4ce/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java b/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
index 9329ace..ac2e5ff 100644
--- a/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
@@ -26,6 +26,9 @@ import java.io.OutputStream;
import java.io.PrintWriter;
import junit.framework.TestCase;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultExchange;
/**
* @version
@@ -99,4 +102,17 @@ public class IOHelperTest extends TestCase {
out.print(text);
out.close();
}
+
+ public void testCharsetName() throws Exception {
+ Exchange exchange = new DefaultExchange((CamelContext) null);
+
+ assertNull(IOHelper.getCharsetName(exchange, false));
+
+ exchange.getIn().setHeader(Exchange.CHARSET_NAME, "iso-8859-1");
+ assertEquals("iso-8859-1", IOHelper.getCharsetName(exchange, false));
+
+ exchange.getIn().removeHeader(Exchange.CHARSET_NAME);
+ exchange.setProperty(Exchange.CHARSET_NAME, "iso-8859-1");
+ assertEquals("iso-8859-1", IOHelper.getCharsetName(exchange, false));
+ }
}
[05/11] git commit: Upgrade to CXF 2.7.7
Posted by da...@apache.org.
Upgrade to CXF 2.7.7
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8270ae3a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8270ae3a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8270ae3a
Branch: refs/heads/master
Commit: 8270ae3a0956ed5dde401d58ed2ff38053b51a46
Parents: 3db34bc
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Sep 28 13:41:48 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Sep 28 13:41:48 2013 +0200
----------------------------------------------------------------------
parent/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/8270ae3a/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index e81c95a..fbc7fb1 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -105,7 +105,7 @@
<commons-vfs2-version>2.0</commons-vfs2-version>
<concurrentlinkedhashmap.version>1.4</concurrentlinkedhashmap.version>
<cobertura-maven-plugin-version>2.5.2</cobertura-maven-plugin-version>
- <cxf-version>2.7.6</cxf-version>
+ <cxf-version>2.7.7</cxf-version>
<cxf-version-range>[2.6,2.9)</cxf-version-range>
<cxf-xjc-utils-version>2.6.2</cxf-xjc-utils-version>
<deltaspike-version>0.3-incubating</deltaspike-version>
[04/11] git commit: CAMEL-6796: camel-xmlsecurity - Some options is
not exposed as getter/setters
Posted by da...@apache.org.
CAMEL-6796: camel-xmlsecurity - Some options is not exposed as getter/setters
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3db34bc2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3db34bc2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3db34bc2
Branch: refs/heads/master
Commit: 3db34bc277cdc6028e5af3592250952a5981b1c4
Parents: e73ed4c
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Sep 28 13:01:32 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Sep 28 13:01:32 2013 +0200
----------------------------------------------------------------------
.../processor/XmlSignerConfiguration.java | 65 ++++++++++++++------
1 file changed, 47 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/3db34bc2/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
index cb8fdde..15f1158 100644
--- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
+++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
@@ -211,8 +211,7 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
* Signature algorithm. Default value is
* "http://www.w3.org/2000/09/xmldsig#rsa-sha1".
*
- * @param signatureAlgorithm
- * signature algorithm
+ * @param signatureAlgorithm signature algorithm
*/
public void setSignatureAlgorithm(String signatureAlgorithm) {
this.signatureAlgorithm = signatureAlgorithm;
@@ -238,8 +237,7 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
* Only relevant when a KeyInfo is returned by {@link KeyAccessor}. and
* {@link KeyInfo#getId()} is not <code>null</code>.
*
- * @param addKeyInfoReference
- * boolean value
+ * @param addKeyInfoReference boolean value
*/
public void setAddKeyInfoReference(Boolean addKeyInfoReference) {
this.addKeyInfoReference = addKeyInfoReference;
@@ -260,8 +258,7 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
* http://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-
* without-namespaces
*
- * @param prefixForXmlSignatureNamespace
- * prefix
+ * @param prefixForXmlSignatureNamespace prefix
*/
public void setPrefixForXmlSignatureNamespace(String prefixForXmlSignatureNamespace) {
this.prefixForXmlSignatureNamespace = prefixForXmlSignatureNamespace;
@@ -270,13 +267,6 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
public String getParentLocalName() {
return parentLocalName;
}
-
- public String getContentObjectId() {
- if (contentObjectId == null) {
- contentObjectId = "_" + UUID.randomUUID().toString();
- }
- return contentObjectId;
- }
/**
* Local name of the parent element to which the XML signature element will
@@ -284,8 +274,7 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
* <code>null</code>. The value must be <code>null</code> for enveloping XML
* signature.
*
- * @param parentLocalName
- * local name
+ * @param parentLocalName local name
*/
public void setParentLocalName(String parentLocalName) {
this.parentLocalName = parentLocalName;
@@ -297,14 +286,23 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
/**
* Namespace of the parent element to which the XML signature element will
- * be added. See {@link #setEnvelopedParentLocalName(String)}.
- *
- * @param parentNamespace
+ * be added.
*/
public void setParentNamespace(String parentNamespace) {
this.parentNamespace = parentNamespace;
}
+ public String getContentObjectId() {
+ if (contentObjectId == null) {
+ contentObjectId = "_" + UUID.randomUUID().toString();
+ }
+ return contentObjectId;
+ }
+
+ public void setContentObjectId(String contentObjectId) {
+ this.contentObjectId = contentObjectId;
+ }
+
public String getContentReferenceUri() {
return contentReferenceUri;
}
@@ -361,4 +359,35 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
}
}
+ public String getKeyAccessorName() {
+ return keyAccessorName;
+ }
+
+ public void setKeyAccessorName(String keyAccessorName) {
+ this.keyAccessorName = keyAccessorName;
+ }
+
+ public String getCanonicalizationMethodName() {
+ return canonicalizationMethodName;
+ }
+
+ public void setCanonicalizationMethodName(String canonicalizationMethodName) {
+ this.canonicalizationMethodName = canonicalizationMethodName;
+ }
+
+ public String getTransformMethodsName() {
+ return transformMethodsName;
+ }
+
+ public void setTransformMethodsName(String transformMethodsName) {
+ this.transformMethodsName = transformMethodsName;
+ }
+
+ public String getPropertiesName() {
+ return propertiesName;
+ }
+
+ public void setPropertiesName(String propertiesName) {
+ this.propertiesName = propertiesName;
+ }
}
[11/11] git commit: CAMEL-5771 IOHelper.getCharsetName() should
lookup CHARSET_NAME in headers if exchange property is not set
Posted by da...@apache.org.
CAMEL-5771 IOHelper.getCharsetName() should lookup CHARSET_NAME in headers if exchange property is not set
Conflicts:
camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/499fb031
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/499fb031
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/499fb031
Branch: refs/heads/camel-2.11.x
Commit: 499fb031966edc69ad1e1c5b5344c1188534873d
Parents: 8f8f2e9
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Sep 28 12:46:29 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Sep 28 13:44:58 2013 +0200
----------------------------------------------------------------------
.../org/apache/camel/converter/IOConverter.java | 2 +-
.../main/java/org/apache/camel/util/IOHelper.java | 12 ++++++++----
.../java/org/apache/camel/util/IOHelperTest.java | 17 +++++++++++++++++
3 files changed, 26 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/499fb031/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java b/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
index 269b948..2c12d11 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
@@ -428,7 +428,7 @@ public final class IOConverter {
}
/**
- * Gets the charset name if set as property {@link Exchange#CHARSET_NAME}.
+ * Gets the charset name if set as header or property {@link Exchange#CHARSET_NAME}.
*
* @param exchange the exchange
* @param useDefault should we fallback and use JVM default charset if no property existed?
http://git-wip-us.apache.org/repos/asf/camel/blob/499fb031/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
index 179d526..e2fdfaf 100644
--- a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
@@ -385,13 +385,16 @@ public final class IOHelper {
}
}
+ /**
+ * @see #getCharsetName(org.apache.camel.Exchange, boolean)
+ */
public static String getCharsetName(Exchange exchange) {
return getCharsetName(exchange, true);
}
/**
- * Gets the charset name if set as property or header {@link Exchange#CHARSET_NAME}.
- * Notice: The lookup from the property has priority over the header
+ * Gets the charset name if set as header or property {@link Exchange#CHARSET_NAME}.
+ * <b>Notice:</b> The lookup from the header has priority over the property.
*
* @param exchange the exchange
* @param useDefault should we fallback and use JVM default charset if no property existed?
@@ -399,9 +402,10 @@ public final class IOHelper {
*/
public static String getCharsetName(Exchange exchange, boolean useDefault) {
if (exchange != null) {
- String charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
+ // header takes precedence
+ String charsetName = exchange.getIn().getHeader(Exchange.CHARSET_NAME, String.class);
if (charsetName == null) {
- charsetName = exchange.getIn().getHeader(Exchange.CHARSET_NAME, String.class);
+ charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
}
if (charsetName != null) {
return IOHelper.normalizeCharset(charsetName);
http://git-wip-us.apache.org/repos/asf/camel/blob/499fb031/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java b/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
index 0e2231f..a980cbd 100644
--- a/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
@@ -23,6 +23,9 @@ import java.io.InputStream;
import java.io.OutputStream;
import junit.framework.TestCase;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultExchange;
/**
* @version
@@ -63,4 +66,18 @@ public class IOHelperTest extends TestCase {
assertEquals("UTF-8", IOHelper.normalizeCharset("\"UTF-8 \""));
assertEquals("UTF-8", IOHelper.normalizeCharset("\' UTF-8\'"));
}
+
+ public void testCharsetName() throws Exception {
+ Exchange exchange = new DefaultExchange((CamelContext) null);
+
+ assertNull(IOHelper.getCharsetName(exchange, false));
+
+ exchange.getIn().setHeader(Exchange.CHARSET_NAME, "iso-8859-1");
+ assertEquals("iso-8859-1", IOHelper.getCharsetName(exchange, false));
+
+ exchange.getIn().removeHeader(Exchange.CHARSET_NAME);
+ exchange.setProperty(Exchange.CHARSET_NAME, "iso-8859-1");
+ assertEquals("iso-8859-1", IOHelper.getCharsetName(exchange, false));
+ }
+
}
[08/11] git commit: CAMEL-6796: camel-xmlsecurity - Some options is
not exposed as getter/setters
Posted by da...@apache.org.
CAMEL-6796: camel-xmlsecurity - Some options is not exposed as getter/setters
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/95912fc8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/95912fc8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/95912fc8
Branch: refs/heads/camel-2.12.x
Commit: 95912fc8199710d0e088e5ffebcb72609f00ecae
Parents: 93743f5
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Sep 28 13:01:32 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Sep 28 13:44:29 2013 +0200
----------------------------------------------------------------------
.../processor/XmlSignerConfiguration.java | 65 ++++++++++++++------
1 file changed, 47 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/95912fc8/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
index cb8fdde..15f1158 100644
--- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
+++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
@@ -211,8 +211,7 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
* Signature algorithm. Default value is
* "http://www.w3.org/2000/09/xmldsig#rsa-sha1".
*
- * @param signatureAlgorithm
- * signature algorithm
+ * @param signatureAlgorithm signature algorithm
*/
public void setSignatureAlgorithm(String signatureAlgorithm) {
this.signatureAlgorithm = signatureAlgorithm;
@@ -238,8 +237,7 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
* Only relevant when a KeyInfo is returned by {@link KeyAccessor}. and
* {@link KeyInfo#getId()} is not <code>null</code>.
*
- * @param addKeyInfoReference
- * boolean value
+ * @param addKeyInfoReference boolean value
*/
public void setAddKeyInfoReference(Boolean addKeyInfoReference) {
this.addKeyInfoReference = addKeyInfoReference;
@@ -260,8 +258,7 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
* http://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-
* without-namespaces
*
- * @param prefixForXmlSignatureNamespace
- * prefix
+ * @param prefixForXmlSignatureNamespace prefix
*/
public void setPrefixForXmlSignatureNamespace(String prefixForXmlSignatureNamespace) {
this.prefixForXmlSignatureNamespace = prefixForXmlSignatureNamespace;
@@ -270,13 +267,6 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
public String getParentLocalName() {
return parentLocalName;
}
-
- public String getContentObjectId() {
- if (contentObjectId == null) {
- contentObjectId = "_" + UUID.randomUUID().toString();
- }
- return contentObjectId;
- }
/**
* Local name of the parent element to which the XML signature element will
@@ -284,8 +274,7 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
* <code>null</code>. The value must be <code>null</code> for enveloping XML
* signature.
*
- * @param parentLocalName
- * local name
+ * @param parentLocalName local name
*/
public void setParentLocalName(String parentLocalName) {
this.parentLocalName = parentLocalName;
@@ -297,14 +286,23 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
/**
* Namespace of the parent element to which the XML signature element will
- * be added. See {@link #setEnvelopedParentLocalName(String)}.
- *
- * @param parentNamespace
+ * be added.
*/
public void setParentNamespace(String parentNamespace) {
this.parentNamespace = parentNamespace;
}
+ public String getContentObjectId() {
+ if (contentObjectId == null) {
+ contentObjectId = "_" + UUID.randomUUID().toString();
+ }
+ return contentObjectId;
+ }
+
+ public void setContentObjectId(String contentObjectId) {
+ this.contentObjectId = contentObjectId;
+ }
+
public String getContentReferenceUri() {
return contentReferenceUri;
}
@@ -361,4 +359,35 @@ public class XmlSignerConfiguration extends XmlSignatureConfiguration {
}
}
+ public String getKeyAccessorName() {
+ return keyAccessorName;
+ }
+
+ public void setKeyAccessorName(String keyAccessorName) {
+ this.keyAccessorName = keyAccessorName;
+ }
+
+ public String getCanonicalizationMethodName() {
+ return canonicalizationMethodName;
+ }
+
+ public void setCanonicalizationMethodName(String canonicalizationMethodName) {
+ this.canonicalizationMethodName = canonicalizationMethodName;
+ }
+
+ public String getTransformMethodsName() {
+ return transformMethodsName;
+ }
+
+ public void setTransformMethodsName(String transformMethodsName) {
+ this.transformMethodsName = transformMethodsName;
+ }
+
+ public String getPropertiesName() {
+ return propertiesName;
+ }
+
+ public void setPropertiesName(String propertiesName) {
+ this.propertiesName = propertiesName;
+ }
}
[10/11] git commit: CAMEL-5771 IOHelper.getCharsetName() should
lookup CHARSET_NAME in headers if exchange property is not set
Posted by da...@apache.org.
CAMEL-5771 IOHelper.getCharsetName() should lookup CHARSET_NAME in headers if exchange property is not set
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8f8f2e91
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8f8f2e91
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8f8f2e91
Branch: refs/heads/camel-2.11.x
Commit: 8f8f2e9106e9498a2d9b4e5b101d1934c753f525
Parents: 45d5377
Author: Marco Zapletal <ma...@edistream.com>
Authored: Tue Sep 24 18:59:00 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Sep 28 13:44:50 2013 +0200
----------------------------------------------------------------------
camel-core/src/main/java/org/apache/camel/util/IOHelper.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/8f8f2e91/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
index 6799274..179d526 100644
--- a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
@@ -390,7 +390,8 @@ public final class IOHelper {
}
/**
- * Gets the charset name if set as property {@link Exchange#CHARSET_NAME}.
+ * Gets the charset name if set as property or header {@link Exchange#CHARSET_NAME}.
+ * Notice: The lookup from the property has priority over the header
*
* @param exchange the exchange
* @param useDefault should we fallback and use JVM default charset if no property existed?
@@ -399,6 +400,9 @@ public final class IOHelper {
public static String getCharsetName(Exchange exchange, boolean useDefault) {
if (exchange != null) {
String charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
+ if (charsetName == null) {
+ charsetName = exchange.getIn().getHeader(Exchange.CHARSET_NAME, String.class);
+ }
if (charsetName != null) {
return IOHelper.normalizeCharset(charsetName);
}
[06/11] git commit: CAMEL-5771 IOHelper.getCharsetName() should
lookup CHARSET_NAME in headers if exchange property is not set
Posted by da...@apache.org.
CAMEL-5771 IOHelper.getCharsetName() should lookup CHARSET_NAME in headers if exchange property is not set
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3b032653
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3b032653
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3b032653
Branch: refs/heads/camel-2.12.x
Commit: 3b032653fb1772cc60aeff089cf8da6883b45699
Parents: 258e7d6
Author: Marco Zapletal <ma...@edistream.com>
Authored: Tue Sep 24 18:59:00 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Sep 28 13:43:24 2013 +0200
----------------------------------------------------------------------
camel-core/src/main/java/org/apache/camel/util/IOHelper.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/3b032653/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
index 3f24e09..e7d9184 100644
--- a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
@@ -417,7 +417,8 @@ public final class IOHelper {
}
/**
- * Gets the charset name if set as property {@link Exchange#CHARSET_NAME}.
+ * Gets the charset name if set as property or header {@link Exchange#CHARSET_NAME}.
+ * Notice: The lookup from the property has priority over the header
*
* @param exchange the exchange
* @param useDefault should we fallback and use JVM default charset if no property existed?
@@ -426,6 +427,9 @@ public final class IOHelper {
public static String getCharsetName(Exchange exchange, boolean useDefault) {
if (exchange != null) {
String charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
+ if (charsetName == null) {
+ charsetName = exchange.getIn().getHeader(Exchange.CHARSET_NAME, String.class);
+ }
if (charsetName != null) {
return IOHelper.normalizeCharset(charsetName);
}
[07/11] git commit: CAMEL-5771 IOHelper.getCharsetName() should
lookup CHARSET_NAME in headers if exchange property is not set
Posted by da...@apache.org.
CAMEL-5771 IOHelper.getCharsetName() should lookup CHARSET_NAME in headers if exchange property is not set
Conflicts:
camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/93743f59
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/93743f59
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/93743f59
Branch: refs/heads/camel-2.12.x
Commit: 93743f597d52f238f21ef52772c60c155430c9fb
Parents: 3b03265
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Sep 28 12:46:29 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Sep 28 13:44:11 2013 +0200
----------------------------------------------------------------------
.../org/apache/camel/converter/IOConverter.java | 2 +-
.../main/java/org/apache/camel/util/IOHelper.java | 12 ++++++++----
.../java/org/apache/camel/util/IOHelperTest.java | 17 +++++++++++++++++
3 files changed, 26 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/93743f59/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java b/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
index 8107b49..02995fa 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
@@ -428,7 +428,7 @@ public final class IOConverter {
}
/**
- * Gets the charset name if set as property {@link Exchange#CHARSET_NAME}.
+ * Gets the charset name if set as header or property {@link Exchange#CHARSET_NAME}.
*
* @param exchange the exchange
* @param useDefault should we fallback and use JVM default charset if no property existed?
http://git-wip-us.apache.org/repos/asf/camel/blob/93743f59/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
index e7d9184..8a52b5b 100644
--- a/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
@@ -412,13 +412,16 @@ public final class IOHelper {
}
}
+ /**
+ * @see #getCharsetName(org.apache.camel.Exchange, boolean)
+ */
public static String getCharsetName(Exchange exchange) {
return getCharsetName(exchange, true);
}
/**
- * Gets the charset name if set as property or header {@link Exchange#CHARSET_NAME}.
- * Notice: The lookup from the property has priority over the header
+ * Gets the charset name if set as header or property {@link Exchange#CHARSET_NAME}.
+ * <b>Notice:</b> The lookup from the header has priority over the property.
*
* @param exchange the exchange
* @param useDefault should we fallback and use JVM default charset if no property existed?
@@ -426,9 +429,10 @@ public final class IOHelper {
*/
public static String getCharsetName(Exchange exchange, boolean useDefault) {
if (exchange != null) {
- String charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
+ // header takes precedence
+ String charsetName = exchange.getIn().getHeader(Exchange.CHARSET_NAME, String.class);
if (charsetName == null) {
- charsetName = exchange.getIn().getHeader(Exchange.CHARSET_NAME, String.class);
+ charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
}
if (charsetName != null) {
return IOHelper.normalizeCharset(charsetName);
http://git-wip-us.apache.org/repos/asf/camel/blob/93743f59/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java b/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
index 0e2231f..a980cbd 100644
--- a/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/IOHelperTest.java
@@ -23,6 +23,9 @@ import java.io.InputStream;
import java.io.OutputStream;
import junit.framework.TestCase;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultExchange;
/**
* @version
@@ -63,4 +66,18 @@ public class IOHelperTest extends TestCase {
assertEquals("UTF-8", IOHelper.normalizeCharset("\"UTF-8 \""));
assertEquals("UTF-8", IOHelper.normalizeCharset("\' UTF-8\'"));
}
+
+ public void testCharsetName() throws Exception {
+ Exchange exchange = new DefaultExchange((CamelContext) null);
+
+ assertNull(IOHelper.getCharsetName(exchange, false));
+
+ exchange.getIn().setHeader(Exchange.CHARSET_NAME, "iso-8859-1");
+ assertEquals("iso-8859-1", IOHelper.getCharsetName(exchange, false));
+
+ exchange.getIn().removeHeader(Exchange.CHARSET_NAME);
+ exchange.setProperty(Exchange.CHARSET_NAME, "iso-8859-1");
+ assertEquals("iso-8859-1", IOHelper.getCharsetName(exchange, false));
+ }
+
}
[02/11] git commit: Merge branch 'master' of
https://github.com/mzapletal/camel
Posted by da...@apache.org.
Merge branch 'master' of https://github.com/mzapletal/camel
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/48e3d8d3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/48e3d8d3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/48e3d8d3
Branch: refs/heads/master
Commit: 48e3d8d3f6741042325ace5bb520cd768b48d389
Parents: 542103e 9f47f31
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Sep 28 12:41:57 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Sep 28 12:41:57 2013 +0200
----------------------------------------------------------------------
camel-core/src/main/java/org/apache/camel/util/IOHelper.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------