Author: ningjiang
Date: Fri Jan  2 22:12:15 2009
New Revision: 730916

URL: http://svn.apache.org/viewvc?rev=730916&view=rev
Log:
CAMEL-1214 Added username and password options for basic authentication

Modified:
    
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java

Modified: 
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java?rev=730916&r1=730915&r2=730916&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
 (original)
+++ 
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
 Fri Jan  2 22:12:15 2009
@@ -79,6 +79,13 @@
             httpBinding = 
CamelContextHelper.mandatoryLookup(getCamelContext(), ref, HttpBinding.class);
         }
         
+        // check the user name and password for basic authentication
+        String username = getAndRemoveParameter(parameters, "username", 
String.class);
+        String password = getAndRemoveParameter(parameters, "password", 
String.class);
+        if (username != null && password != null) {
+            httpClientConfigurer = new 
BasicAuthenticationHttpClientConfigurer(username, password);
+        }
+        
         // lookup http client front configurer in the registry if provided
         ref = getAndRemoveParameter(parameters, "httpClientConfigurerRef", 
String.class);
         if (ref != null) {


Reply via email to