派生自 projectDept/qhighschool

胡仁荣
2022-10-31 fe7381d6e8ec1f427408de0297ac7f41533202f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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();
    }
      
}