FileDocCategorySizeDatePackage
RFC2109VersionHandler.javaAPI DocAndroid 1.5 API2909Wed May 06 22:41:10 BST 2009org.apache.http.impl.cookie

RFC2109VersionHandler

public class RFC2109VersionHandler extends AbstractCookieAttributeHandler

Fields Summary
Constructors Summary
public RFC2109VersionHandler()

        super();
    
Methods Summary
public voidparse(org.apache.http.cookie.SetCookie cookie, java.lang.String value)

        if (cookie == null) {
            throw new IllegalArgumentException("Cookie may not be null");
        }
        if (value == null) {
            throw new MalformedCookieException("Missing value for version attribute");
        }
        if (value.trim().length() == 0) {
            throw new MalformedCookieException("Blank value for version attribute");
        }
        try {
           cookie.setVersion(Integer.parseInt(value));
        } catch (NumberFormatException e) {
            throw new MalformedCookieException("Invalid version: " 
                + e.getMessage());
        }
    
public voidvalidate(org.apache.http.cookie.Cookie cookie, org.apache.http.cookie.CookieOrigin origin)

        if (cookie == null) {
            throw new IllegalArgumentException("Cookie may not be null");
        }
        if (cookie.getVersion() < 0) {
            throw new MalformedCookieException("Cookie version may not be negative");
        }