1.文件名格式:test.txt
2.获取文件类型扩展名
/**
* 获取文件的扩展类型
*
* @param fileName
* @return
*/
public static String getExtention(String fileFileName) {
String ret = "";
try {
int pos = fileFileName.lastIndexOf(".");// 文件名分隔符位置
if (pos != -1) {
ret = fileFileName.substring(pos);
ret = ret.toLowerCase();
}
} catch (Exception ex) {
log.error("helper:get the file extention process error!");
ex.printStackTrace();
}
return ret;
}/**
* 获取文件的扩