!471 新增一个取文件名而不带后缀的整合方法,干净又卫生啊兄弟们

Merge pull request !471 from XCSDN/N/A
feature/model
若依 3 years ago committed by Gitee
commit 0c820b96d8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -17,6 +17,7 @@ import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.apache.commons.io.FilenameUtils;
/**
*
@ -257,7 +258,7 @@ public class FileUtils
/**
*
*
* : /profile/upload/2022/04/16/ruoyi.png, : ruoyi.png
* @param fileName
* @return
*/
@ -272,4 +273,19 @@ public class FileUtils
int index = Math.max(lastUnixPos, lastWindowsPos);
return fileName.substring(index + 1);
}
/**
*
* : /profile/upload/2022/04/16/ruoyi.png, : ruoyi
* @param fileName
* @return
*/
public static String getNameNotSuffix(String fileName) {
if (fileName == null) {
return null;
}
String baseName = FilenameUtils.getBaseName(fileName);
return baseName;
}
}

Loading…
Cancel
Save