Rabbit-R1/android (non root)/smali/smali_classes3/com/google/common/io/Resources.smali
2024-05-21 17:08:36 -04:00

269 lines
6.9 KiB
Smali

.class public final Lcom/google/common/io/Resources;
.super Ljava/lang/Object;
.source "Resources.java"
# annotations
.annotation runtime Lcom/google/common/io/ElementTypesAreNonnullByDefault;
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/common/io/Resources$UrlByteSource;
}
.end annotation
# direct methods
.method private constructor <init>()V
.locals 0
.line 46
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static asByteSource(Ljava/net/URL;)Lcom/google/common/io/ByteSource;
.locals 2
.line 54
new-instance v0, Lcom/google/common/io/Resources$UrlByteSource;
const/4 v1, 0x0
invoke-direct {v0, p0, v1}, Lcom/google/common/io/Resources$UrlByteSource;-><init>(Ljava/net/URL;Lcom/google/common/io/Resources$1;)V
return-object v0
.end method
.method public static asCharSource(Ljava/net/URL;Ljava/nio/charset/Charset;)Lcom/google/common/io/CharSource;
.locals 0
.line 83
invoke-static {p0}, Lcom/google/common/io/Resources;->asByteSource(Ljava/net/URL;)Lcom/google/common/io/ByteSource;
move-result-object p0
invoke-virtual {p0, p1}, Lcom/google/common/io/ByteSource;->asCharSource(Ljava/nio/charset/Charset;)Lcom/google/common/io/CharSource;
move-result-object p0
return-object p0
.end method
.method public static copy(Ljava/net/URL;Ljava/io/OutputStream;)V
.locals 0
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 171
invoke-static {p0}, Lcom/google/common/io/Resources;->asByteSource(Ljava/net/URL;)Lcom/google/common/io/ByteSource;
move-result-object p0
invoke-virtual {p0, p1}, Lcom/google/common/io/ByteSource;->copyTo(Ljava/io/OutputStream;)J
return-void
.end method
.method public static getResource(Ljava/lang/Class;Ljava/lang/String;)Ljava/net/URL;
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/Class<",
"*>;",
"Ljava/lang/String;",
")",
"Ljava/net/URL;"
}
.end annotation
.line 206
invoke-virtual {p0, p1}, Ljava/lang/Class;->getResource(Ljava/lang/String;)Ljava/net/URL;
move-result-object v0
if-eqz v0, :cond_0
const/4 v1, 0x1
goto :goto_0
:cond_0
const/4 v1, 0x0
:goto_0
const-string v2, "resource %s relative to %s not found."
.line 208
invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object p0
.line 207
invoke-static {v1, v2, p1, p0}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
return-object v0
.end method
.method public static getResource(Ljava/lang/String;)Ljava/net/URL;
.locals 3
.line 192
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Thread;->getContextClassLoader()Ljava/lang/ClassLoader;
move-result-object v0
const-class v1, Lcom/google/common/io/Resources;
invoke-virtual {v1}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
move-result-object v1
.line 191
invoke-static {v0, v1}, Lcom/google/common/base/MoreObjects;->firstNonNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/ClassLoader;
.line 193
invoke-virtual {v0, p0}, Ljava/lang/ClassLoader;->getResource(Ljava/lang/String;)Ljava/net/URL;
move-result-object v0
if-eqz v0, :cond_0
const/4 v1, 0x1
goto :goto_0
:cond_0
const/4 v1, 0x0
:goto_0
const-string v2, "resource %s not found."
.line 194
invoke-static {v1, v2, p0}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
return-object v0
.end method
.method public static readLines(Ljava/net/URL;Ljava/nio/charset/Charset;Lcom/google/common/io/LineProcessor;)Ljava/lang/Object;
.locals 0
.annotation runtime Lcom/google/common/io/ParametricNullness;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Ljava/net/URL;",
"Ljava/nio/charset/Charset;",
"Lcom/google/common/io/LineProcessor<",
"TT;>;)TT;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 125
invoke-static {p0, p1}, Lcom/google/common/io/Resources;->asCharSource(Ljava/net/URL;Ljava/nio/charset/Charset;)Lcom/google/common/io/CharSource;
move-result-object p0
invoke-virtual {p0, p2}, Lcom/google/common/io/CharSource;->readLines(Lcom/google/common/io/LineProcessor;)Ljava/lang/Object;
move-result-object p0
return-object p0
.end method
.method public static readLines(Ljava/net/URL;Ljava/nio/charset/Charset;)Ljava/util/List;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/net/URL;",
"Ljava/nio/charset/Charset;",
")",
"Ljava/util/List<",
"Ljava/lang/String;",
">;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 144
new-instance v0, Lcom/google/common/io/Resources$1;
invoke-direct {v0}, Lcom/google/common/io/Resources$1;-><init>()V
invoke-static {p0, p1, v0}, Lcom/google/common/io/Resources;->readLines(Ljava/net/URL;Ljava/nio/charset/Charset;Lcom/google/common/io/LineProcessor;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Ljava/util/List;
return-object p0
.end method
.method public static toByteArray(Ljava/net/URL;)[B
.locals 0
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 94
invoke-static {p0}, Lcom/google/common/io/Resources;->asByteSource(Ljava/net/URL;)Lcom/google/common/io/ByteSource;
move-result-object p0
invoke-virtual {p0}, Lcom/google/common/io/ByteSource;->read()[B
move-result-object p0
return-object p0
.end method
.method public static toString(Ljava/net/URL;Ljava/nio/charset/Charset;)Ljava/lang/String;
.locals 0
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 107
invoke-static {p0, p1}, Lcom/google/common/io/Resources;->asCharSource(Ljava/net/URL;Ljava/nio/charset/Charset;)Lcom/google/common/io/CharSource;
move-result-object p0
invoke-virtual {p0}, Lcom/google/common/io/CharSource;->read()Ljava/lang/String;
move-result-object p0
return-object p0
.end method