首页>代码>基于SpringBoot框架开发的简单商城后台管理系统>/myshop/src/main/java/com/jacklin/myshop/common/ExcelImportUtils.java
package com.jacklin.myshop.common;

/**
 * 导入工具类
 */
public class ExcelImportUtils {
    // @描述:是否是2003的excel,返回true是2003
    public static boolean isExcel2003(String filePath) {
        return filePath.matches("^.+\\.(?i)(xls)$");
    }

    //@描述:是否是2007的excel,返回true是2007
    public static boolean isExcel2007(String filePath) {
        return filePath.matches("^.+\\.(?i)(xlsx)$");
    }

    /**
     * 验证EXCEL文件
     *
     * @param filePath
     * @return
     */
    public static boolean validateExcel(String filePath) {
        if (filePath == null || !(isExcel2003(filePath) || isExcel2007(filePath))) {
            return false;
        }
        return true;
    }

}
最近下载更多
15578157792  LV7 2024年10月24日
artemiszer0  LV2 2024年7月4日
zhezhizzzz  LV2 2024年6月29日
TY0165  LV20 2024年6月26日
计科一班  LV7 2024年6月18日
yyhrhv  LV8 2024年5月30日
llllllK  LV5 2024年5月13日
Luck_ZDM  LV12 2024年4月12日
jay1992  LV14 2024年3月11日
nvcore  LV1 2024年2月1日
最近浏览更多
sn764889012 4月16日
暂无贡献等级
cainiao1101 2月11日
暂无贡献等级
王愉悦  LV4 2024年12月3日
haomc052829  LV4 2024年12月3日
yoyo123  LV1 2024年11月26日
wanglonggggg 2024年11月8日
暂无贡献等级
yangchengshuai  LV15 2024年10月29日
15578157792  LV7 2024年10月24日
bluerstar  LV1 2024年10月23日
hhr1101  LV2 2024年10月21日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友