discord-jadx/app/src/main/java/androidx/core/net/UriKt.java

34 lines
1.1 KiB
Java

package androidx.core.net;
import android.net.Uri;
import d0.z.d.m;
import java.io.File;
/* compiled from: Uri.kt */
public final class UriKt {
public static final File toFile(Uri uri) {
m.checkNotNullParameter(uri, "<this>");
if (m.areEqual(uri.getScheme(), "file")) {
String path = uri.getPath();
if (path != null) {
return new File(path);
}
throw new IllegalArgumentException(m.stringPlus("Uri path is null: ", uri).toString());
}
throw new IllegalArgumentException(m.stringPlus("Uri lacks 'file' scheme: ", uri).toString());
}
public static final Uri toUri(File file) {
m.checkNotNullParameter(file, "<this>");
Uri fromFile = Uri.fromFile(file);
m.checkNotNullExpressionValue(fromFile, "fromFile(this)");
return fromFile;
}
public static final Uri toUri(String str) {
m.checkNotNullParameter(str, "<this>");
Uri parse = Uri.parse(str);
m.checkNotNullExpressionValue(parse, "parse(this)");
return parse;
}
}