avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craft...@apache.org
Subject cvs commit: avalon-excalibur/sourceresolve/src/java/org/apache/excalibur/source/impl HTTPClientSource.java
Date Mon, 15 Sep 2003 12:28:08 GMT
crafterm    2003/09/15 05:28:08

  Modified:    sourceresolve/src/java/org/apache/excalibur/source/impl
                        HTTPClientSource.java
  Log:
  Added support for request headers via source parameters.
  
  Revision  Changes    Path
  1.8       +19 -1     avalon-excalibur/sourceresolve/src/java/org/apache/excalibur/source/impl/HTTPClientSource.java
  
  Index: HTTPClientSource.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/sourceresolve/src/java/org/apache/excalibur/source/impl/HTTPClientSource.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HTTPClientSource.java	30 Jul 2003 12:22:17 -0000	1.7
  +++ HTTPClientSource.java	15 Sep 2003 12:28:08 -0000	1.8
  @@ -328,7 +328,25 @@
        */
       private GetMethod createGetMethod( final String uri )
       {
  -        return new GetMethod( uri );
  +        final GetMethod method = new GetMethod( uri );
  +
  +        // add all parameters as headers
  +        for ( final Iterator i = m_parameters.keySet().iterator(); i.hasNext(); )
  +        {
  +            final String key = (String) i.next();
  +            final String value = (String) m_parameters.get( key );
  +
  +            if ( getLogger().isDebugEnabled() ) 
  +            {
  +                getLogger().debug(
  +                    "Adding header '" + key + "', with value '" + value + "'"
  +                );
  +            }
  +
  +            method.setRequestHeader( key, value );
  +        }
  +
  +        return method;
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message