Browse Source

[improve][api] Support to upload file without file type suffix (#9553)

3.0.0/version-upgrade
exmy 3 years ago committed by GitHub
parent
commit
267b307632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java

4
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); String nameSuffix = Files.getFileExtension(name);
// determine file suffix // determine file suffix
if (!(StringUtils.isNotEmpty(fileSuffix) && fileSuffix.equalsIgnoreCase(nameSuffix))) { if (!fileSuffix.equalsIgnoreCase(nameSuffix)) {
// rename file suffix and original suffix must be consistent // rename file suffix and original suffix must be consistent
logger.error("rename file suffix and original suffix must be consistent: {}", RegexUtils.escapeNRT(file.getOriginalFilename())); logger.error("rename file suffix and original suffix must be consistent: {}", RegexUtils.escapeNRT(file.getOriginalFilename()));
putMsg(result, Status.RESOURCE_SUFFIX_FORBID_CHANGE); putMsg(result, Status.RESOURCE_SUFFIX_FORBID_CHANGE);
@ -629,7 +629,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
String nameSuffix = Files.getFileExtension(fullName); String nameSuffix = Files.getFileExtension(fullName);
// determine file suffix // determine file suffix
if (!(StringUtils.isNotEmpty(fileSuffix) && fileSuffix.equalsIgnoreCase(nameSuffix))) { if (!fileSuffix.equalsIgnoreCase(nameSuffix)) {
return false; return false;
} }
// query tenant // query tenant

Loading…
Cancel
Save