package com.njcn.utils;

/**
 * @author hongawen
 * @date: 2020/9/9 09:46
 */
public class JudgeFileType {


    /**
     * 判断文件名是否以.xlsx作为后缀
     * @param fileName 文件名
     */
    public static boolean judgeExcel(String fileName){
        boolean flag=false;
        int pointIndex=fileName.lastIndexOf(".");
        String suffixName=fileName.substring(pointIndex);
        if(".xlsx".equalsIgnoreCase(suffixName)){
            flag=true;
        }
        return flag;
    }


    /**
     * 判断文件名是否以.xlsx作为后缀
     * @param fileName 文件名
     */
    public static boolean judgeBin(String fileName){
        boolean flag=false;
        int pointIndex=fileName.lastIndexOf(".");
        String suffixName=fileName.substring(pointIndex);
        if(".bin".equalsIgnoreCase(suffixName)){
            flag=true;
        }
        return flag;
    }


}
