package o;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.s20, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2395s20 extends AbstractC1628jy {
    public static final SV e;
    public final ClassLoader b;
    public final C2704vJ c = AbstractC1628jy.a;
    public final C1014dc0 d = new C1014dc0(new U4(22, this));

    static {
        String str = SV.m;
        e = BP.n("/");
    }

    public C2395s20(ClassLoader classLoader) {
        this.b = classLoader;
    }

    public static String l(SV sv) {
        SV sv2 = e;
        sv2.getClass();
        return AbstractC1153f.b(sv2, sv, true).c(sv2).l.n();
    }

    @Override // o.AbstractC1628jy
    public final R80 a(SV sv) throws IOException {
        throw new IOException(this + " is read-only");
    }

    @Override // o.AbstractC1628jy
    public final void b(SV sv, SV sv2) throws IOException {
        throw new IOException(this + " is read-only");
    }

    @Override // o.AbstractC1628jy
    public final void c(SV sv) throws IOException {
        throw new IOException(this + " is read-only");
    }

    @Override // o.AbstractC1628jy
    public final void d(SV sv) throws IOException {
        throw new IOException(this + " is read-only");
    }

    @Override // o.AbstractC1628jy
    public final List f(SV sv) throws FileNotFoundException {
        String strL = l(sv);
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        boolean z = false;
        for (C3001yV c3001yV : (List) this.d.getValue()) {
            AbstractC1628jy abstractC1628jy = (AbstractC1628jy) c3001yV.l;
            SV sv2 = (SV) c3001yV.m;
            try {
                List listF = abstractC1628jy.f(sv2.d(strL));
                ArrayList arrayList = new ArrayList();
                for (Object obj : listF) {
                    if (C2616uQ.k((SV) obj)) {
                        arrayList.add(obj);
                    }
                }
                ArrayList arrayList2 = new ArrayList(AbstractC0034Bi.W(arrayList, 10));
                int size = arrayList.size();
                int i = 0;
                while (i < size) {
                    Object obj2 = arrayList.get(i);
                    i++;
                    arrayList2.add(e.d(Za0.f0(((SV) obj2).l.n(), sv2.l.n()).replace('\\', '/')));
                }
                AbstractC0138Fi.Y(arrayList2, linkedHashSet);
                z = true;
            } catch (IOException unused) {
            }
        }
        if (z) {
            return AbstractC3117zi.t0(linkedHashSet);
        }
        throw new FileNotFoundException("file not found: " + sv);
    }

    @Override // o.AbstractC1628jy
    public final C3135zr h(SV sv) {
        if (!C2616uQ.k(sv)) {
            return null;
        }
        String strL = l(sv);
        for (C3001yV c3001yV : (List) this.d.getValue()) {
            C3135zr c3135zrH = ((AbstractC1628jy) c3001yV.l).h(((SV) c3001yV.m).d(strL));
            if (c3135zrH != null) {
                return c3135zrH;
            }
        }
        return null;
    }

    @Override // o.AbstractC1628jy
    public final C2609uJ i(SV sv) throws FileNotFoundException {
        if (!C2616uQ.k(sv)) {
            throw new FileNotFoundException("file not found: " + sv);
        }
        String strL = l(sv);
        for (C3001yV c3001yV : (List) this.d.getValue()) {
            try {
                return ((AbstractC1628jy) c3001yV.l).i(((SV) c3001yV.m).d(strL));
            } catch (FileNotFoundException unused) {
            }
        }
        throw new FileNotFoundException("file not found: " + sv);
    }

    @Override // o.AbstractC1628jy
    public final R80 j(SV sv) throws IOException {
        throw new IOException(this + " is read-only");
    }

    @Override // o.AbstractC1628jy
    public final T90 k(SV sv) throws FileNotFoundException {
        if (!C2616uQ.k(sv)) {
            throw new FileNotFoundException("file not found: " + sv);
        }
        SV sv2 = e;
        sv2.getClass();
        InputStream resourceAsStream = this.b.getResourceAsStream(AbstractC1153f.b(sv2, sv, false).c(sv2).l.n());
        if (resourceAsStream != null) {
            return AbstractC0940cn0.I(resourceAsStream);
        }
        throw new FileNotFoundException("file not found: " + sv);
    }
}
