192 lines
4.7 KiB
Smali
192 lines
4.7 KiB
Smali
.class public final Lokhttp3/MultipartBody$a;
|
|
.super Ljava/lang/Object;
|
|
.source "MultipartBody.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lokhttp3/MultipartBody;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "a"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private final bmO:Lokio/ByteString;
|
|
|
|
.field private final bmR:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lokhttp3/MultipartBody$Part;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private bmS:Lokhttp3/MediaType;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/util/UUID;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v0}, Lokhttp3/MultipartBody$a;-><init>(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>(Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
sget-object v0, Lokhttp3/MultipartBody;->bmG:Lokhttp3/MediaType;
|
|
|
|
iput-object v0, p0, Lokhttp3/MultipartBody$a;->bmS:Lokhttp3/MediaType;
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lokhttp3/MultipartBody$a;->bmR:Ljava/util/List;
|
|
|
|
invoke-static {p1}, Lokio/ByteString;->em(Ljava/lang/String;)Lokio/ByteString;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lokhttp3/MultipartBody$a;->bmO:Lokio/ByteString;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final AG()Lokhttp3/MultipartBody;
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Lokhttp3/MultipartBody$a;->bmR:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
new-instance v0, Lokhttp3/MultipartBody;
|
|
|
|
iget-object v1, p0, Lokhttp3/MultipartBody$a;->bmO:Lokio/ByteString;
|
|
|
|
iget-object v2, p0, Lokhttp3/MultipartBody$a;->bmS:Lokhttp3/MediaType;
|
|
|
|
iget-object v3, p0, Lokhttp3/MultipartBody$a;->bmR:Ljava/util/List;
|
|
|
|
invoke-direct {v0, v1, v2, v3}, Lokhttp3/MultipartBody;-><init>(Lokio/ByteString;Lokhttp3/MediaType;Ljava/util/List;)V
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "Multipart body must have at least one part."
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final a(Lokhttp3/Headers;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$a;
|
|
.locals 0
|
|
.param p1 # Lokhttp3/Headers;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
invoke-static {p1, p2}, Lokhttp3/MultipartBody$Part;->b(Lokhttp3/Headers;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0, p1}, Lokhttp3/MultipartBody$a;->a(Lokhttp3/MultipartBody$Part;)Lokhttp3/MultipartBody$a;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final a(Lokhttp3/MediaType;)Lokhttp3/MultipartBody$a;
|
|
.locals 2
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
iget-object v0, p1, Lokhttp3/MediaType;->type:Ljava/lang/String;
|
|
|
|
const-string v1, "multipart"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iput-object p1, p0, Lokhttp3/MultipartBody$a;->bmS:Lokhttp3/MediaType;
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v1, "multipart != "
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)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, "type == null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final a(Lokhttp3/MultipartBody$Part;)Lokhttp3/MultipartBody$a;
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lokhttp3/MultipartBody$a;->bmR:Ljava/util/List;
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/NullPointerException;
|
|
|
|
const-string v0, "part == null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|