jsp或者JAVA如何获取文件的后缀名字吗?
public String getFileType(String fileUri){
File file = new File(fileUri);
String fineName = file.getName();
String fileType = fileName.substring(fileName.lastIndexOf(\".\")+1,fileName.length())
return fileType;
}
public String getFileType(String fileUri){
File file = new File(fileUri);
String fineName = file.getName();
String fileType = fileName.substring(fileName.lastIndexOf(\".\")+1,fileName.length())
return fileType;
}