From 910fe6261b2818a93aa618a66565666b4f7d7b9e Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 16 Apr 2022 22:06:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=B8=A6=E5=90=8E=E7=BC=80=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/utils/file/FileUtils.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index bde1987..f8a39d3 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -257,8 +257,8 @@ public class FileUtils } /** - * 获取名称 - * 例如: /profile/upload/2022/04/16/ruoyi.png, 返回: ruoyi.png + * 获取文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi.png + * * @param fileName 路径名称 * @return 没有文件路径的名称 */ @@ -275,13 +275,15 @@ public class FileUtils } /** - * 获取名称 - * 例如: /profile/upload/2022/04/16/ruoyi.png, 返回: ruoyi + * 获取不带后缀文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi + * * @param fileName 路径名称 - * @return 没有文件路径的名称 + * @return 没有文件路径和后缀的名称 */ - public static String getNameNotSuffix(String fileName) { - if (fileName == null) { + public static String getNameNotSuffix(String fileName) + { + if (fileName == null) + { return null; } String baseName = FilenameUtils.getBaseName(fileName);