package com.bxzk.afxj.util;

import android.os.Environment;

import java.io.File;
import java.io.IOException;

public class PathUtil {
    public static String getBaseCachePath() {
        File file = new File(Environment.getExternalStorageDirectory() + "/DYF/t");
        if (!file.exists()) {
            file.getParentFile().mkdirs();
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return Environment.getExternalStorageDirectory() + "/DYF/";
    }

    public static String getImageCachePath() {
        File file = new File(Environment.getExternalStorageDirectory() + "/DYF/" + "image/t");
        if (!file.exists()) {
            file.getParentFile().mkdirs();
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return Environment.getExternalStorageDirectory() + "/DYF/" + "image/";
    }

    public static String getGlideCachePath() {
        File file = new File(Environment.getExternalStorageDirectory() + "/DYF/" + "image/Glide/t");
        if (!file.exists()) {
            file.getParentFile().mkdirs();
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
//            LogUtils.LogW("创建文件夹",file.mkdirs() + "");
        }

        return Environment.getExternalStorageDirectory() + "/DYF/" + "image/Glide/";
    }

    public static String getImageIDCachePath() {
        File file = new File(Environment.getExternalStorageDirectory() + "/DYF/" + "image/" + "/IDCard/t");
        if (!file.exists()) {
            file.getParentFile().mkdirs();
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return Environment.getExternalStorageDirectory() + "/DYF/" + "image/" + "/IDCard/";
    }

    public static String getFileCachePath() {
        File file = new File(Environment.getExternalStorageDirectory() + "/DYF/" + "file/t");
        if (!file.exists()) {
            file.getParentFile().mkdirs();
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return Environment.getExternalStorageDirectory() + "/DYF/" + "file/";
    }
}
