package u1; import android.util.Log; import java.io.File; import java.io.IOException; import o1.b; import u1.a; /* loaded from: classes.dex */ public class e implements a { /* renamed from: b, reason: collision with root package name */ private final File f14644b; /* renamed from: c, reason: collision with root package name */ private final long f14645c; /* renamed from: e, reason: collision with root package name */ private o1.b f14647e; /* renamed from: d, reason: collision with root package name */ private final c f14646d = new c(); /* renamed from: a, reason: collision with root package name */ private final j f14643a = new j(); protected e(File file, long j10) { this.f14644b = file; this.f14645c = j10; } public static a c(File file, long j10) { return new e(file, j10); } private synchronized o1.b d() { if (this.f14647e == null) { this.f14647e = o1.b.w0(this.f14644b, 1, 1, this.f14645c); } return this.f14647e; } @Override // u1.a public void a(q1.f fVar, a.b bVar) { o1.b d10; String b10 = this.f14643a.b(fVar); this.f14646d.a(b10); try { if (Log.isLoggable("DiskLruCacheWrapper", 2)) { Log.v("DiskLruCacheWrapper", "Put: Obtained: " + b10 + " for for Key: " + fVar); } try { d10 = d(); } catch (IOException e10) { if (Log.isLoggable("DiskLruCacheWrapper", 5)) { Log.w("DiskLruCacheWrapper", "Unable to put to disk cache", e10); } } if (d10.r0(b10) != null) { return; } b.c m02 = d10.m0(b10); if (m02 == null) { throw new IllegalStateException("Had two simultaneous puts for: " + b10); } try { if (bVar.a(m02.f(0))) { m02.e(); } m02.b(); } catch (Throwable th) { m02.b(); throw th; } } finally { this.f14646d.b(b10); } } @Override // u1.a public File b(q1.f fVar) { String b10 = this.f14643a.b(fVar); if (Log.isLoggable("DiskLruCacheWrapper", 2)) { Log.v("DiskLruCacheWrapper", "Get: Obtained: " + b10 + " for for Key: " + fVar); } try { b.e r02 = d().r0(b10); if (r02 != null) { return r02.a(0); } return null; } catch (IOException e10) { if (!Log.isLoggable("DiskLruCacheWrapper", 5)) { return null; } Log.w("DiskLruCacheWrapper", "Unable to get from disk cache", e10); return null; } } }