package c.f.b.b; import androidx.annotation.VisibleForTesting; import c.f.b.a.d; import c.f.b.b.c; import com.airbnb.lottie.parser.AnimatableValueParser; import com.facebook.common.file.FileUtils$CreateDirectoryException; import com.facebook.common.internal.Supplier; import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.Objects; /* compiled from: DynamicDefaultDiskStorage */ public class e implements c { public final int a; public final Supplier b; /* renamed from: c reason: collision with root package name */ public final String f362c; public final c.f.b.a.a d; @VisibleForTesting public volatile a e = new a(null, null); /* compiled from: DynamicDefaultDiskStorage */ @VisibleForTesting public static class a { public final c a; public final File b; @VisibleForTesting public a(File file, c cVar) { this.a = cVar; this.b = file; } } public e(int i, Supplier supplier, String str, c.f.b.a.a aVar) { this.a = i; this.d = aVar; this.b = supplier; this.f362c = str; } @Override // c.f.b.b.c public void a() { try { i().a(); } catch (IOException e) { c.f.d.e.a.b(e.class, "purgeUnexpectedResources", e); } } @Override // c.f.b.b.c public c.b b(String str, Object obj) throws IOException { return i().b(str, obj); } @Override // c.f.b.b.c public boolean c(String str, Object obj) throws IOException { return i().c(str, obj); } @Override // c.f.b.b.c public c.f.a.a d(String str, Object obj) throws IOException { return i().d(str, obj); } @Override // c.f.b.b.c public Collection e() throws IOException { return i().e(); } @Override // c.f.b.b.c public long f(String str) throws IOException { return i().f(str); } @Override // c.f.b.b.c public long g(c.a aVar) throws IOException { return i().g(aVar); } public final void h() throws IOException { File file = new File(this.b.get(), this.f362c); try { AnimatableValueParser.N1(file); file.getAbsolutePath(); int i = c.f.d.e.a.a; this.e = new a(file, new a(file, this.a, this.d)); } catch (FileUtils$CreateDirectoryException e) { Objects.requireNonNull((d) this.d); throw e; } } /* JADX WARNING: Removed duplicated region for block: B:12:0x0017 */ @VisibleForTesting public synchronized c i() throws IOException { boolean z2; c cVar; File file; a aVar = this.e; if (!(aVar.a == null || (file = aVar.b) == null)) { if (file.exists()) { z2 = false; if (z2) { if (!(this.e.a == null || this.e.b == null)) { AnimatableValueParser.b0(this.e.b); } h(); } cVar = this.e.a; Objects.requireNonNull(cVar); } } z2 = true; if (z2) { } cVar = this.e.a; Objects.requireNonNull(cVar); return cVar; } @Override // c.f.b.b.c public boolean isExternal() { try { return i().isExternal(); } catch (IOException unused) { return false; } } }