.class public Lorg/apache/http/impl/cookie/RFC2965VersionAttributeHandler; .super Ljava/lang/Object; .source "RFC2965VersionAttributeHandler.java" # interfaces .implements Lorg/apache/http/cookie/CookieAttributeHandler; # annotations .annotation build Lorg/apache/http/annotation/Immutable; .end annotation # direct methods .method public constructor ()V .locals 0 .line 1 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method # virtual methods .method public match(Lorg/apache/http/cookie/Cookie;Lorg/apache/http/cookie/CookieOrigin;)Z .locals 0 const/4 p1, 0x1 return p1 .end method .method public parse(Lorg/apache/http/cookie/SetCookie;Ljava/lang/String;)V .locals 0 .annotation system Ldalvik/annotation/Throws; value = { Lorg/apache/http/cookie/MalformedCookieException; } .end annotation if-eqz p1, :cond_2 if-eqz p2, :cond_1 .line 1 :try_start_0 invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I move-result p2 :try_end_0 .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_0 :catch_0 const/4 p2, -0x1 :goto_0 if-ltz p2, :cond_0 .line 2 invoke-interface {p1, p2}, Lorg/apache/http/cookie/SetCookie;->setVersion(I)V return-void .line 3 :cond_0 new-instance p1, Lorg/apache/http/cookie/MalformedCookieException; const-string p2, "Invalid cookie version." invoke-direct {p1, p2}, Lorg/apache/http/cookie/MalformedCookieException;->(Ljava/lang/String;)V throw p1 .line 4 :cond_1 new-instance p1, Lorg/apache/http/cookie/MalformedCookieException; const-string p2, "Missing value for version attribute" invoke-direct {p1, p2}, Lorg/apache/http/cookie/MalformedCookieException;->(Ljava/lang/String;)V throw p1 .line 5 :cond_2 new-instance p1, Ljava/lang/IllegalArgumentException; const-string p2, "Cookie may not be null" invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p1 .end method .method public validate(Lorg/apache/http/cookie/Cookie;Lorg/apache/http/cookie/CookieOrigin;)V .locals 0 .annotation system Ldalvik/annotation/Throws; value = { Lorg/apache/http/cookie/MalformedCookieException; } .end annotation if-eqz p1, :cond_2 .line 1 instance-of p2, p1, Lorg/apache/http/cookie/SetCookie2; if-eqz p2, :cond_1 .line 2 instance-of p2, p1, Lorg/apache/http/cookie/ClientCookie; if-eqz p2, :cond_1 check-cast p1, Lorg/apache/http/cookie/ClientCookie; const-string p2, "version" invoke-interface {p1, p2}, Lorg/apache/http/cookie/ClientCookie;->containsAttribute(Ljava/lang/String;)Z move-result p1 if-eqz p1, :cond_0 goto :goto_0 .line 3 :cond_0 new-instance p1, Lorg/apache/http/cookie/MalformedCookieException; const-string p2, "Violates RFC 2965. Version attribute is required." invoke-direct {p1, p2}, Lorg/apache/http/cookie/MalformedCookieException;->(Ljava/lang/String;)V throw p1 :cond_1 :goto_0 return-void .line 4 :cond_2 new-instance p1, Ljava/lang/IllegalArgumentException; const-string p2, "Cookie may not be null" invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p1 .end method