package com.ifpdos.autotest.lancontrol.module.other.f;

import android.os.Environment;
import b.c.d.c.a;
import f.k;
import f.m;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;

/* JADX INFO: compiled from: FileUtils.java */
/* JADX INFO: loaded from: classes.dex */
public class c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private static final String f2197a = Environment.getExternalStorageDirectory().getAbsolutePath();

    public static File a(String str) {
        if (str == null) {
            return null;
        }
        List<a.n> listE = b.c.d.c.a.b().e();
        if (!listE.isEmpty()) {
            Iterator<a.n> it = listE.iterator();
            while (it.hasNext()) {
                File file = new File(it.next().f1505a + "/" + str);
                if (file.exists() && file.isFile()) {
                    return file;
                }
            }
        }
        return null;
    }

    public static String b(String str) {
        File fileA = a(str);
        return fileA == null ? "" : fileA.getAbsolutePath();
    }

    public static String c(File file) {
        f.c cVar = new f.c();
        try {
            try {
                k kVarC = k.c(m.j(file));
                while (kVarC.read(cVar, 8192L) != -1) {
                    cVar.b();
                }
                return kVarC.b().j();
            } catch (IOException e2) {
                e2.printStackTrace();
                cVar.close();
                return "";
            }
        } finally {
            cVar.close();
        }
    }
}
