hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r165652 - in /jakarta/httpclient/trunk/http-common/src/java/org/apache/http: HttpMutableMessage.java impl/BasicHttpMessage.java
Date Mon, 02 May 2005 17:53:28 GMT
Author: olegk
Date: Mon May  2 10:53:27 2005
New Revision: 165652

URL: http://svn.apache.org/viewcvs?rev=165652&view=rev
Log:
Added method to HttpMutableMessage to remove headers by name

Modified:
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableMessage.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpMessage.java

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableMessage.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableMessage.java?rev=165652&r1=165651&r2=165652&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableMessage.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableMessage.java
Mon May  2 10:53:27 2005
@@ -50,6 +50,8 @@
 
     void removeHeader(Header header);
     
+    void removeHeaders(String name);
+    
     Iterator headerIterator();
     
     void setParams(HttpParams params);

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpMessage.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpMessage.java?rev=165652&r1=165651&r2=165652&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpMessage.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpMessage.java
Mon May  2 10:53:27 2005
@@ -95,6 +95,18 @@
         this.headergroup.removeHeader(header);
     }
     
+    public void removeHeaders(final String name) {
+        if (name == null) {
+            return;
+        }
+        for (Iterator i = this.headergroup.iterator(); i.hasNext(); ) {
+            Header header = (Header) i.next();
+            if (name.equalsIgnoreCase(header.getName())) {
+                i.remove();
+            }
+        }
+    }
+    
     public Iterator headerIterator() {
         return this.headergroup.iterator();
     }



Mime
View raw message