discord-jadx/app/src/main/java/com/discord/utilities/attachments/AttachmentUtilsKt$getMimeTy...

25 lines
853 B
Java

package com.discord.utilities.attachments;
import android.webkit.MimeTypeMap;
import d0.z.d.m;
import d0.z.d.o;
import java.util.regex.Matcher;
import kotlin.jvm.functions.Function1;
/* compiled from: AttachmentUtils.kt */
public final class AttachmentUtilsKt$getMimeType$1 extends o implements Function1<String, String> {
public static final AttachmentUtilsKt$getMimeType$1 INSTANCE = new AttachmentUtilsKt$getMimeType$1();
public AttachmentUtilsKt$getMimeType$1() {
super(1);
}
public final String invoke(String str) {
m.checkNotNullParameter(str, "file");
Matcher matcher = AttachmentUtilsKt.access$getREGEX_FILE_NAME_PATTERN$p().matcher(str);
if (!matcher.matches()) {
return null;
}
return MimeTypeMap.getSingleton().getMimeTypeFromExtension(matcher.group(2));
}
}