123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573 |
- .class public Lokhttp3/Request$Builder;
- .super Ljava/lang/Object;
- .source ""
- # annotations
- .annotation system Ldalvik/annotation/EnclosingClass;
- value = Lokhttp3/Request;
- .end annotation
- .annotation system Ldalvik/annotation/InnerClass;
- accessFlags = 0x9
- name = "Builder"
- .end annotation
- # instance fields
- .field body:Lokhttp3/RequestBody;
- .field headers:Lokhttp3/Headers$Builder;
- .field method:Ljava/lang/String;
- .field tag:Ljava/lang/Object;
- .field url:Lokhttp3/HttpUrl;
- # direct methods
- .method public constructor <init>()V
- .locals 1
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- const-string v0, "GET"
- iput-object v0, p0, Lokhttp3/Request$Builder;->method:Ljava/lang/String;
- new-instance v0, Lokhttp3/Headers$Builder;
- invoke-direct {v0}, Lokhttp3/Headers$Builder;-><init>()V
- iput-object v0, p0, Lokhttp3/Request$Builder;->headers:Lokhttp3/Headers$Builder;
- return-void
- .end method
- .method constructor <init>(Lokhttp3/Request;)V
- .locals 1
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- iget-object v0, p1, Lokhttp3/Request;->url:Lokhttp3/HttpUrl;
- iput-object v0, p0, Lokhttp3/Request$Builder;->url:Lokhttp3/HttpUrl;
- iget-object v0, p1, Lokhttp3/Request;->method:Ljava/lang/String;
- iput-object v0, p0, Lokhttp3/Request$Builder;->method:Ljava/lang/String;
- iget-object v0, p1, Lokhttp3/Request;->body:Lokhttp3/RequestBody;
- iput-object v0, p0, Lokhttp3/Request$Builder;->body:Lokhttp3/RequestBody;
- iget-object v0, p1, Lokhttp3/Request;->tag:Ljava/lang/Object;
- iput-object v0, p0, Lokhttp3/Request$Builder;->tag:Ljava/lang/Object;
- iget-object p1, p1, Lokhttp3/Request;->headers:Lokhttp3/Headers;
- invoke-virtual {p1}, Lokhttp3/Headers;->newBuilder()Lokhttp3/Headers$Builder;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/Request$Builder;->headers:Lokhttp3/Headers$Builder;
- return-void
- .end method
- # virtual methods
- .method public addHeader(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;
- .locals 1
- iget-object v0, p0, Lokhttp3/Request$Builder;->headers:Lokhttp3/Headers$Builder;
- invoke-virtual {v0, p1, p2}, Lokhttp3/Headers$Builder;->add(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
- return-object p0
- .end method
- .method public build()Lokhttp3/Request;
- .locals 2
- iget-object v0, p0, Lokhttp3/Request$Builder;->url:Lokhttp3/HttpUrl;
- if-eqz v0, :cond_0
- new-instance v0, Lokhttp3/Request;
- invoke-direct {v0, p0}, Lokhttp3/Request;-><init>(Lokhttp3/Request$Builder;)V
- return-object v0
- :cond_0
- new-instance v0, Ljava/lang/IllegalStateException;
- const-string v1, "url == null"
- invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw v0
- .end method
- .method public cacheControl(Lokhttp3/CacheControl;)Lokhttp3/Request$Builder;
- .locals 2
- invoke-virtual {p1}, Lokhttp3/CacheControl;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-virtual {p1}, Ljava/lang/String;->isEmpty()Z
- move-result v0
- const-string v1, "Cache-Control"
- if-eqz v0, :cond_0
- invoke-virtual {p0, v1}, Lokhttp3/Request$Builder;->removeHeader(Ljava/lang/String;)Lokhttp3/Request$Builder;
- move-result-object p1
- return-object p1
- :cond_0
- invoke-virtual {p0, v1, p1}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;
- move-result-object p1
- return-object p1
- .end method
- .method public delete()Lokhttp3/Request$Builder;
- .locals 1
- sget-object v0, Lokhttp3/internal/Util;->EMPTY_REQUEST:Lokhttp3/RequestBody;
- invoke-virtual {p0, v0}, Lokhttp3/Request$Builder;->delete(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- move-result-object v0
- return-object v0
- .end method
- .method public delete(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- .locals 1
- const-string v0, "DELETE"
- invoke-virtual {p0, v0, p1}, Lokhttp3/Request$Builder;->method(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- move-result-object p1
- return-object p1
- .end method
- .method public get()Lokhttp3/Request$Builder;
- .locals 2
- const-string v0, "GET"
- const/4 v1, 0x0
- invoke-virtual {p0, v0, v1}, Lokhttp3/Request$Builder;->method(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- move-result-object v0
- return-object v0
- .end method
- .method public head()Lokhttp3/Request$Builder;
- .locals 2
- const-string v0, "HEAD"
- const/4 v1, 0x0
- invoke-virtual {p0, v0, v1}, Lokhttp3/Request$Builder;->method(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- move-result-object v0
- return-object v0
- .end method
- .method public header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;
- .locals 1
- iget-object v0, p0, Lokhttp3/Request$Builder;->headers:Lokhttp3/Headers$Builder;
- invoke-virtual {v0, p1, p2}, Lokhttp3/Headers$Builder;->set(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
- return-object p0
- .end method
- .method public headers(Lokhttp3/Headers;)Lokhttp3/Request$Builder;
- .locals 0
- invoke-virtual {p1}, Lokhttp3/Headers;->newBuilder()Lokhttp3/Headers$Builder;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/Request$Builder;->headers:Lokhttp3/Headers$Builder;
- return-object p0
- .end method
- .method public method(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- .locals 2
- if-eqz p1, :cond_5
- invoke-virtual {p1}, Ljava/lang/String;->length()I
- move-result v0
- if-eqz v0, :cond_4
- const-string v0, "method "
- if-eqz p2, :cond_1
- invoke-static {p1}, Lokhttp3/internal/http/HttpMethod;->permitsRequestBody(Ljava/lang/String;)Z
- move-result v1
- if-eqz v1, :cond_0
- goto :goto_0
- :cond_0
- new-instance p2, Ljava/lang/IllegalArgumentException;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string p1, " must not have a request body."
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p2
- :cond_1
- :goto_0
- if-nez p2, :cond_3
- invoke-static {p1}, Lokhttp3/internal/http/HttpMethod;->requiresRequestBody(Ljava/lang/String;)Z
- move-result v1
- if-nez v1, :cond_2
- goto :goto_1
- :cond_2
- new-instance p2, Ljava/lang/IllegalArgumentException;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string p1, " must have a request body."
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p2
- :cond_3
- :goto_1
- iput-object p1, p0, Lokhttp3/Request$Builder;->method:Ljava/lang/String;
- iput-object p2, p0, Lokhttp3/Request$Builder;->body:Lokhttp3/RequestBody;
- return-object p0
- :cond_4
- new-instance p1, Ljava/lang/IllegalArgumentException;
- const-string p2, "method.length() == 0"
- invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw p1
- :cond_5
- new-instance p1, Ljava/lang/NullPointerException;
- const-string p2, "method == null"
- invoke-direct {p1, p2}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
- throw p1
- .end method
- .method public patch(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- .locals 1
- const-string v0, "PATCH"
- invoke-virtual {p0, v0, p1}, Lokhttp3/Request$Builder;->method(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- move-result-object p1
- return-object p1
- .end method
- .method public post(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- .locals 1
- const-string v0, "POST"
- invoke-virtual {p0, v0, p1}, Lokhttp3/Request$Builder;->method(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- move-result-object p1
- return-object p1
- .end method
- .method public put(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- .locals 1
- const-string v0, "PUT"
- invoke-virtual {p0, v0, p1}, Lokhttp3/Request$Builder;->method(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- move-result-object p1
- return-object p1
- .end method
- .method public removeHeader(Ljava/lang/String;)Lokhttp3/Request$Builder;
- .locals 1
- iget-object v0, p0, Lokhttp3/Request$Builder;->headers:Lokhttp3/Headers$Builder;
- invoke-virtual {v0, p1}, Lokhttp3/Headers$Builder;->removeAll(Ljava/lang/String;)Lokhttp3/Headers$Builder;
- return-object p0
- .end method
- .method public tag(Ljava/lang/Object;)Lokhttp3/Request$Builder;
- .locals 0
- iput-object p1, p0, Lokhttp3/Request$Builder;->tag:Ljava/lang/Object;
- return-object p0
- .end method
- .method public url(Ljava/lang/String;)Lokhttp3/Request$Builder;
- .locals 6
- if-eqz p1, :cond_3
- const/4 v1, 0x1
- const/4 v2, 0x0
- const/4 v4, 0x0
- const/4 v5, 0x3
- const-string v3, "ws:"
- move-object v0, p1
- invoke-virtual/range {v0 .. v5}, Ljava/lang/String;->regionMatches(ZILjava/lang/String;II)Z
- move-result v0
- if-eqz v0, :cond_0
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- const-string v1, "http:"
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const/4 v1, 0x3
- :goto_0
- invoke-virtual {p1, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;
- move-result-object p1
- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- goto :goto_1
- :cond_0
- const/4 v1, 0x1
- const/4 v2, 0x0
- const/4 v4, 0x0
- const/4 v5, 0x4
- const-string v3, "wss:"
- move-object v0, p1
- invoke-virtual/range {v0 .. v5}, Ljava/lang/String;->regionMatches(ZILjava/lang/String;II)Z
- move-result v0
- if-eqz v0, :cond_1
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- const-string v1, "https:"
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const/4 v1, 0x4
- goto :goto_0
- :cond_1
- :goto_1
- invoke-static {p1}, Lokhttp3/HttpUrl;->parse(Ljava/lang/String;)Lokhttp3/HttpUrl;
- move-result-object v0
- if-eqz v0, :cond_2
- invoke-virtual {p0, v0}, Lokhttp3/Request$Builder;->url(Lokhttp3/HttpUrl;)Lokhttp3/Request$Builder;
- move-result-object p1
- return-object p1
- :cond_2
- new-instance v0, Ljava/lang/IllegalArgumentException;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- const-string v2, "unexpected url: "
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw v0
- :cond_3
- new-instance p1, Ljava/lang/NullPointerException;
- const-string v0, "url == null"
- invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
- goto :goto_3
- :goto_2
- throw p1
- :goto_3
- goto :goto_2
- .end method
- .method public url(Ljava/net/URL;)Lokhttp3/Request$Builder;
- .locals 3
- if-eqz p1, :cond_1
- invoke-static {p1}, Lokhttp3/HttpUrl;->get(Ljava/net/URL;)Lokhttp3/HttpUrl;
- move-result-object v0
- if-eqz v0, :cond_0
- invoke-virtual {p0, v0}, Lokhttp3/Request$Builder;->url(Lokhttp3/HttpUrl;)Lokhttp3/Request$Builder;
- move-result-object p1
- return-object p1
- :cond_0
- new-instance v0, Ljava/lang/IllegalArgumentException;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- const-string v2, "unexpected url: "
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw v0
- :cond_1
- new-instance p1, Ljava/lang/NullPointerException;
- const-string v0, "url == null"
- invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
- throw p1
- .end method
- .method public url(Lokhttp3/HttpUrl;)Lokhttp3/Request$Builder;
- .locals 1
- if-eqz p1, :cond_0
- iput-object p1, p0, Lokhttp3/Request$Builder;->url:Lokhttp3/HttpUrl;
- return-object p0
- :cond_0
- new-instance p1, Ljava/lang/NullPointerException;
- const-string v0, "url == null"
- invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
- throw p1
- .end method
|