package com.qxueyou.scc.base.util;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
/**
|
* 文件工具类
|
* @author xiadehu
|
*
|
*/
|
public final class QFileUtils {
|
|
/**
|
* 根据后缀名得到文件类型
|
* @param fileName
|
* @return
|
*/
|
public static String getFileFormat(String fileName){
|
|
if(StringUtils.isEmpty(fileName)) {
|
return "DATA";
|
}
|
|
int lastDotIdx = fileName.lastIndexOf('.');
|
return lastDotIdx<0?"DATA":fileName.substring(lastDotIdx+1).toUpperCase();
|
}
|
|
}
|