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 2009/04/03 08:41:35 UTC
svn commit: r761538 - in /camel/branches/camel-1.x: ./
components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomComponent.java
components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomProducerTest.java
Author: davsclaus
Date: Fri Apr 3 06:41:34 2009
New Revision: 761538
URL: http://svn.apache.org/viewvc?rev=761538&view=rev
Log:
Merged revisions 761536 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r761536 | davsclaus | 2009-04-03 08:37:02 +0200 (Fri, 03 Apr 2009) | 1 line
CAMEL-1496: Atom and RSS supports having URI parameteres on http/https feeds.
........
Modified:
camel/branches/camel-1.x/ (props changed)
camel/branches/camel-1.x/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomComponent.java
camel/branches/camel-1.x/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomProducerTest.java
Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 3 06:41:34 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536
Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-1.x/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomComponent.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomComponent.java?rev=761538&r1=761537&r2=761538&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomComponent.java (original)
+++ camel/branches/camel-1.x/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomComponent.java Fri Apr 3 06:41:34 2009
@@ -16,21 +16,34 @@
*/
package org.apache.camel.component.atom;
+import java.net.URI;
import java.util.Map;
import org.apache.camel.Endpoint;
import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.util.URISupport;
/**
* An <a href="http://activemq.apache.org/camel/atom.html">Atom Component</a>.
* <p/>
- * Camel uses Apache Abdera as the Atom implementation.
+ * Camel uses Apache Abdera as the Atom implementation.
*
* @version $Revision$
*/
public class AtomComponent extends DefaultComponent {
protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {
+
+ // Parameters should be kept in the remaining path, since they might be needed to get the actual ATOM feed
+ URI remainingUri = URISupport.createRemainingURI(new URI(remaining), parameters);
+
+ // if http or https then the uri should include the parameters as we can have URI parameters
+ // that need to be sent to the remote server when retrieving feeds
+ String scheme = remainingUri.getScheme();
+ if (scheme != null && (scheme.equals("http") || scheme.equals("https"))) {
+ return new AtomEndpoint(uri, this, remainingUri.toString());
+ }
+
return new AtomEndpoint(uri, this, remaining);
}
Modified: camel/branches/camel-1.x/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomProducerTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomProducerTest.java?rev=761538&r1=761537&r2=761538&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomProducerTest.java (original)
+++ camel/branches/camel-1.x/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomProducerTest.java Fri Apr 3 06:41:34 2009
@@ -25,7 +25,7 @@
public void testNotYetImplemented() throws Exception {
try {
- context.getEndpoint("atom:file:target/out.atom").createProducer();
+ context.getEndpoint("atom:file://target/out.atom").createProducer();
fail("Should have thrown an UnsupportedOperationException");
} catch (UnsupportedOperationException e) {
// ok