2022-06-10 21:38:30 +09:00

142 lines
3.1 KiB
Smali

.class public Lorg/apache/http/client/methods/HttpOptions;
.super Lorg/apache/http/client/methods/HttpRequestBase;
.source "HttpOptions.java"
# annotations
.annotation build Lorg/apache/http/annotation/NotThreadSafe;
.end annotation
# static fields
.field public static final METHOD_NAME:Ljava/lang/String; = "OPTIONS"
# direct methods
.method public constructor <init>()V
.locals 0
.line 1
invoke-direct {p0}, Lorg/apache/http/client/methods/HttpRequestBase;-><init>()V
return-void
.end method
.method public constructor <init>(Ljava/lang/String;)V
.locals 0
.line 4
invoke-direct {p0}, Lorg/apache/http/client/methods/HttpRequestBase;-><init>()V
.line 5
invoke-static {p1}, Ljava/net/URI;->create(Ljava/lang/String;)Ljava/net/URI;
move-result-object p1
invoke-virtual {p0, p1}, Lorg/apache/http/client/methods/HttpRequestBase;->setURI(Ljava/net/URI;)V
return-void
.end method
.method public constructor <init>(Ljava/net/URI;)V
.locals 0
.line 2
invoke-direct {p0}, Lorg/apache/http/client/methods/HttpRequestBase;-><init>()V
.line 3
invoke-virtual {p0, p1}, Lorg/apache/http/client/methods/HttpRequestBase;->setURI(Ljava/net/URI;)V
return-void
.end method
# virtual methods
.method public getAllowedMethods(Lorg/apache/http/HttpResponse;)Ljava/util/Set;
.locals 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lorg/apache/http/HttpResponse;",
")",
"Ljava/util/Set<",
"Ljava/lang/String;",
">;"
}
.end annotation
if-eqz p1, :cond_2
const-string v0, "Allow"
.line 1
invoke-interface {p1, v0}, Lorg/apache/http/HttpMessage;->headerIterator(Ljava/lang/String;)Lorg/apache/http/HeaderIterator;
move-result-object p1
.line 2
new-instance v0, Ljava/util/HashSet;
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
.line 3
:cond_0
invoke-interface {p1}, Lorg/apache/http/HeaderIterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_1
.line 4
invoke-interface {p1}, Lorg/apache/http/HeaderIterator;->nextHeader()Lorg/apache/http/Header;
move-result-object v1
.line 5
invoke-interface {v1}, Lorg/apache/http/Header;->getElements()[Lorg/apache/http/HeaderElement;
move-result-object v1
.line 6
array-length v2, v1
const/4 v3, 0x0
:goto_0
if-ge v3, v2, :cond_0
aget-object v4, v1, v3
.line 7
invoke-interface {v4}, Lorg/apache/http/HeaderElement;->getName()Ljava/lang/String;
move-result-object v4
invoke-virtual {v0, v4}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
add-int/lit8 v3, v3, 0x1
goto :goto_0
:cond_1
return-object v0
.line 8
:cond_2
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "HTTP response may not be null"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public getMethod()Ljava/lang/String;
.locals 1
const-string v0, "OPTIONS"
return-object v0
.end method