From 267b307632525b5a58a2dc593df1c140cd481a15 Mon Sep 17 00:00:00 2001 From: exmy Date: Fri, 22 Apr 2022 14:42:41 +0800 Subject: [PATCH] [improve][api] Support to upload file without file type suffix (#9553) --- .../api/service/impl/ResourcesServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java index d7439053ce..ae0b672ff9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java @@ -525,7 +525,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe String nameSuffix = Files.getFileExtension(name); // determine file suffix - if (!(StringUtils.isNotEmpty(fileSuffix) && fileSuffix.equalsIgnoreCase(nameSuffix))) { + if (!fileSuffix.equalsIgnoreCase(nameSuffix)) { // rename file suffix and original suffix must be consistent logger.error("rename file suffix and original suffix must be consistent: {}", RegexUtils.escapeNRT(file.getOriginalFilename())); putMsg(result, Status.RESOURCE_SUFFIX_FORBID_CHANGE); @@ -629,7 +629,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe String nameSuffix = Files.getFileExtension(fullName); // determine file suffix - if (!(StringUtils.isNotEmpty(fileSuffix) && fileSuffix.equalsIgnoreCase(nameSuffix))) { + if (!fileSuffix.equalsIgnoreCase(nameSuffix)) { return false; } // query tenant