FileDocCategorySizeDatePackage
HttpVersion.javaAPI DocAndroid 1.5 API3434Wed May 06 22:41:10 BST 2009org.apache.http

HttpVersion

public final class HttpVersion extends ProtocolVersion implements Serializable
Represents an HTTP version, as specified in RFC 2616.
author
Oleg Kalnichevski
version
$Revision: 609106 $ $Date: 2008-01-05 01:15:42 -0800 (Sat, 05 Jan 2008) $

Fields Summary
private static final long
serialVersionUID
public static final String
HTTP
The protocol name.
public static final HttpVersion
HTTP_0_9
HTTP protocol version 0.9
public static final HttpVersion
HTTP_1_0
HTTP protocol version 1.0
public static final HttpVersion
HTTP_1_1
HTTP protocol version 1.1
Constructors Summary
public HttpVersion(int major, int minor)
Create an HTTP protocol version designator.

param
major the major version number of the HTTP protocol
param
minor the minor version number of the HTTP protocol
throws
IllegalArgumentException if either major or minor version number is negative

  

    
                                                   
         
        super(HTTP, major, minor);
    
Methods Summary
public org.apache.http.ProtocolVersionforVersion(int major, int minor)
Obtains a specific HTTP version.

param
major the major version
param
minor the minor version
return
an instance of {@link HttpVersion} with the argument version


        if ((major == this.major) && (minor == this.minor)) {
            return this;
        }

        if (major == 1) {
            if (minor == 0) {
                return HTTP_1_0;
            }
            if (minor == 1) {
                return HTTP_1_1;
            }
        }
        if ((major == 0) && (minor == 9)) {
            return HTTP_0_9;
        }

        // argument checking is done in the constructor
        return new HttpVersion(major, minor);