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

34 lines
1.1 KiB
Java
Raw Normal View History

2021-07-24 02:37:17 +00:00
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.checkParameterIsNotNull(uri, "$this$toFile");
if (m.areEqual(uri.getScheme(), "file")) {
String path = uri.getPath();
if (path != null) {
return new File(path);
}
throw new IllegalArgumentException(("Uri path is null: " + uri).toString());
}
throw new IllegalArgumentException(("Uri lacks 'file' scheme: " + uri).toString());
}
public static final Uri toUri(File file) {
m.checkParameterIsNotNull(file, "$this$toUri");
Uri fromFile = Uri.fromFile(file);
m.checkExpressionValueIsNotNull(fromFile, "Uri.fromFile(this)");
return fromFile;
}
public static final Uri toUri(String str) {
m.checkParameterIsNotNull(str, "$this$toUri");
Uri parse = Uri.parse(str);
m.checkExpressionValueIsNotNull(parse, "Uri.parse(this)");
return parse;
}
}