This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch xpath in repository https://gitbox.apache.org/repos/asf/camel.git
commit 07bd9a51d83db351b2a28b491326b28a9e5483de Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue Apr 23 12:08:19 2019 +0200 CAMEL-13442: camel3 - Move xpath out of camel-core --- bom/camel-bom/pom.xml | 10 ++++++++++ .../cxf/CxfConsumerPayloadXPathClientServerTest.java | 2 +- .../camel/component/cxf/CxfConsumerPayloadXPathTest.java | 2 +- components/camel-xmlsecurity/pom.xml | 15 ++++++++++----- .../xmlsecurity/processor/XmlSignatureProcessor.java | 5 ++--- .../dataformat/xmlsecurity/XMLSecurityDataFormat.java | 4 ++-- .../spring-boot-dm/camel-spring-boot-dependencies/pom.xml | 10 ++++++++++ 7 files changed, 36 insertions(+), 12 deletions(-) diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml index 1cc9aec..cf786f8 100644 --- a/bom/camel-bom/pom.xml +++ b/bom/camel-bom/pom.xml @@ -2990,6 +2990,16 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-xpath</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-xpath-starter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-xslt</artifactId> <version>${project.version}</version> </dependency> diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadXPathClientServerTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadXPathClientServerTest.java index 3589599..650f409 100644 --- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadXPathClientServerTest.java +++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadXPathClientServerTest.java @@ -29,8 +29,8 @@ import org.w3c.dom.Text; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.builder.xml.XPathBuilder; import org.apache.camel.converter.jaxp.XmlConverter; +import org.apache.camel.language.xpath.XPathBuilder; import org.apache.camel.test.junit4.CamelTestSupport; import org.apache.commons.lang.StringUtils; import org.apache.cxf.BusFactory; diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadXPathTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadXPathTest.java index f10fbca..c5acd03 100644 --- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadXPathTest.java +++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadXPathTest.java @@ -23,7 +23,7 @@ import org.apache.camel.Exchange; import org.apache.camel.ExchangePattern; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.builder.xml.XPathBuilder; +import org.apache.camel.language.xpath.XPathBuilder; import org.apache.camel.support.DefaultExchange; import org.apache.camel.test.AvailablePortFinder; import org.apache.camel.test.junit4.CamelTestSupport; diff --git a/components/camel-xmlsecurity/pom.xml b/components/camel-xmlsecurity/pom.xml index 9a8e754..b7fefe5 100644 --- a/components/camel-xmlsecurity/pom.xml +++ b/components/camel-xmlsecurity/pom.xml @@ -33,16 +33,21 @@ <name>Camel :: XML Security</name> <description>Camel Partial XML Encryption/Decryption and XML Signature support</description> - <properties> - </properties> - <dependencies> - <!-- requires camel-core --> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> + <artifactId>camel-support</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-xpath</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-validator</artifactId> + </dependency> + <!-- for base 64 in XAdES --> <dependency> <groupId>commons-codec</groupId> diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureProcessor.java b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureProcessor.java index b86bbb1..39cc89d 100644 --- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureProcessor.java +++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureProcessor.java @@ -33,7 +33,6 @@ import org.apache.camel.Processor; import org.apache.camel.component.validator.DefaultLSResourceResolver; import org.apache.camel.component.xmlsecurity.api.XmlSignatureConstants; import org.apache.camel.component.xmlsecurity.api.XmlSignatureException; -import org.apache.camel.converter.IOConverter; import org.apache.camel.support.ResourceHelper; import org.apache.camel.util.IOHelper; import org.apache.camel.util.ObjectHelper; @@ -109,9 +108,9 @@ public abstract class XmlSignatureProcessor implements Processor { "XML Signature component is wrongly configured: No XML schema found for specified schema resource URI " + schemaResourceUri); } - byte[] bytes = null; + byte[] bytes; try { - bytes = IOConverter.toBytes(is); + bytes = message.getExchange().getContext().getTypeConverter().convertTo(byte[].class, is); } finally { // and make sure to close the input stream after the schema has been loaded IOHelper.close(is); diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormat.java b/components/camel-xmlsecurity/src/main/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormat.java index b09fa28..57f3ac2 100644 --- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormat.java +++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormat.java @@ -48,8 +48,8 @@ import org.w3c.dom.NodeList; import org.apache.camel.CamelContext; import org.apache.camel.CamelContextAware; import org.apache.camel.Exchange; -import org.apache.camel.builder.xml.DefaultNamespaceContext; -import org.apache.camel.builder.xml.XPathBuilder; +import org.apache.camel.language.xpath.DefaultNamespaceContext; +import org.apache.camel.language.xpath.XPathBuilder; import org.apache.camel.spi.DataFormat; import org.apache.camel.spi.DataFormatName; import org.apache.camel.spi.annotations.Dataformat; diff --git a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml index 5e3a5f2..c191928 100644 --- a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml +++ b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml @@ -3205,6 +3205,16 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-xpath</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-xpath-starter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-xslt</artifactId> <version>${project.version}</version> </dependency>