FileDocCategorySizeDatePackage
AbstractHttpMessage.javaAPI DocAndroid 1.5 API5418Wed May 06 22:41:10 BST 2009org.apache.http.message

AbstractHttpMessage

public abstract class AbstractHttpMessage extends Object implements HttpMessage
Basic implementation of an HTTP message that can be modified.
author
Oleg Kalnichevski
version
$Revision: 620287 $
since
4.0

Fields Summary
protected HeaderGroup
headergroup
protected HttpParams
params
Constructors Summary
protected AbstractHttpMessage(HttpParams params)

        super();
        this.headergroup = new HeaderGroup();
        this.params = params;
    
protected AbstractHttpMessage()

        this(null);
    
Methods Summary
public voidaddHeader(org.apache.http.Header header)

        this.headergroup.addHeader(header);
    
public voidaddHeader(java.lang.String name, java.lang.String value)

        if (name == null) {
            throw new IllegalArgumentException("Header name may not be null");
        }
        this.headergroup.addHeader(new BasicHeader(name, value));
    
public booleancontainsHeader(java.lang.String name)

        return this.headergroup.containsHeader(name);
    
public org.apache.http.Header[]getAllHeaders()

        return this.headergroup.getAllHeaders();
    
public org.apache.http.HeadergetFirstHeader(java.lang.String name)

        return this.headergroup.getFirstHeader(name);
    
public org.apache.http.Header[]getHeaders(java.lang.String name)

        return this.headergroup.getHeaders(name);
    
public org.apache.http.HeadergetLastHeader(java.lang.String name)

        return this.headergroup.getLastHeader(name);
    
public org.apache.http.params.HttpParamsgetParams()

        if (this.params == null) {
            this.params = new BasicHttpParams();
        }
        return this.params;
    
public org.apache.http.HeaderIteratorheaderIterator()

        return this.headergroup.iterator();
    
public org.apache.http.HeaderIteratorheaderIterator(java.lang.String name)

        return this.headergroup.iterator(name);
    
public voidremoveHeader(org.apache.http.Header header)

        this.headergroup.removeHeader(header);
    
public voidremoveHeaders(java.lang.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 voidsetHeader(org.apache.http.Header header)

        this.headergroup.updateHeader(header);
    
public voidsetHeader(java.lang.String name, java.lang.String value)

        if (name == null) {
            throw new IllegalArgumentException("Header name may not be null");
        }
        this.headergroup.updateHeader(new BasicHeader(name, value));
    
public voidsetHeaders(org.apache.http.Header[] headers)

        this.headergroup.setHeaders(headers);
    
public voidsetParams(org.apache.http.params.HttpParams params)

        if (params == null) {
            throw new IllegalArgumentException("HTTP parameters may not be null");
        }
        this.params = params;