Package org.apache.commons.httpclient
Class HeaderGroup
- java.lang.Object
 - 
- org.apache.commons.httpclient.HeaderGroup
 
 
- 
@Deprecated public class HeaderGroup extends java.lang.ObjectDeprecated.Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.A class for combining a set of headers. This class allows for multiple headers with the same name and keeps track of the order in which headers were added.- Since:
 - 2.0beta1
 
 
- 
- 
Constructor Summary
Constructors Constructor Description HeaderGroup()Deprecated.Constructor for HeaderGroup. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddHeader(Header header)Deprecated.Adds the given header to the group.voidclear()Deprecated.Removes any contained headers.booleancontainsHeader(java.lang.String name)Deprecated.Tests if headers with the given name are contained within this group.Header[]getAllHeaders()Deprecated.Gets all of the headers contained within this group.HeadergetCondensedHeader(java.lang.String name)Deprecated.Gets a header representing all of the header values with the given name.HeadergetFirstHeader(java.lang.String name)Deprecated.Gets the first header with the given name.Header[]getHeaders(java.lang.String name)Deprecated.Gets all of the headers with the given name.java.util.IteratorgetIterator()Deprecated.Returns an iterator over this group of headers.HeadergetLastHeader(java.lang.String name)Deprecated.Gets the last header with the given name.voidremoveHeader(Header header)Deprecated.Removes the given header.voidsetHeaders(Header[] headers)Deprecated.Sets all of the headers contained within this group overriding any existing headers. 
 - 
 
- 
- 
Method Detail
- 
clear
public void clear()
Deprecated.Removes any contained headers. 
- 
addHeader
public void addHeader(Header header)
Deprecated.Adds the given header to the group. The order in which this header was added is preserved.- Parameters:
 header- the header to add
 
- 
removeHeader
public void removeHeader(Header header)
Deprecated.Removes the given header.- Parameters:
 header- the header to remove
 
- 
setHeaders
public void setHeaders(Header[] headers)
Deprecated.Sets all of the headers contained within this group overriding any existing headers. The headers are added in the order in which they appear in the array.- Parameters:
 headers- the headers to set
 
- 
getCondensedHeader
public Header getCondensedHeader(java.lang.String name)
Deprecated.Gets a header representing all of the header values with the given name. If more that one header with the given name exists the values will be combined with a "," as per RFC 2616.Header name comparison is case insensitive.
- Parameters:
 name- the name of the header(s) to get- Returns:
 - a header with a condensed value or 
nullif no headers by the given name are present 
 
- 
getHeaders
public Header[] getHeaders(java.lang.String name)
Deprecated.Gets all of the headers with the given name. The returned array maintains the relative order in which the headers were added.Header name comparison is case insensitive.
- Parameters:
 name- the name of the header(s) to get- Returns:
 - an array of length >= 0
 
 
- 
getFirstHeader
public Header getFirstHeader(java.lang.String name)
Deprecated.Gets the first header with the given name.Header name comparison is case insensitive.
- Parameters:
 name- the name of the header to get- Returns:
 - the first header or 
null 
 
- 
getLastHeader
public Header getLastHeader(java.lang.String name)
Deprecated.Gets the last header with the given name.Header name comparison is case insensitive.
- Parameters:
 name- the name of the header to get- Returns:
 - the last header or 
null 
 
- 
getAllHeaders
public Header[] getAllHeaders()
Deprecated.Gets all of the headers contained within this group.- Returns:
 - an array of length >= 0
 
 
- 
containsHeader
public boolean containsHeader(java.lang.String name)
Deprecated.Tests if headers with the given name are contained within this group.Header name comparison is case insensitive.
- Parameters:
 name- the header name to test for- Returns:
 trueif at least one header with the name is contained,falseotherwise
 
- 
getIterator
public java.util.Iterator getIterator()
Deprecated.Returns an iterator over this group of headers.- Returns:
 - iterator over this group of headers.
 - Since:
 - 3.0
 
 
 - 
 
 -