Browse Source

[Fix-16346] Fix a bug that prevents re-uploading resource files (#16356)

Co-authored-by: JohnZp <johnzp1109@google.com>
dev
seckiller 4 months ago committed by GitHub
parent
commit
b69ba4a70c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/resource/UpdateFileDtoValidator.java

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/resource/UpdateFileDtoValidator.java

@ -43,7 +43,9 @@ public class UpdateFileDtoValidator extends AbstractResourceValidator<UpdateFile
User loginUser = updateFileDto.getLoginUser(); User loginUser = updateFileDto.getLoginUser();
MultipartFile file = updateFileDto.getFile(); MultipartFile file = updateFileDto.getFile();
if (!Objects.equals(Files.getFileExtension(file.getName()), if (!Objects.equals(
Files.getFileExtension(
file.getOriginalFilename() == null ? file.getName() : file.getOriginalFilename()),
Files.getFileExtension(updateFileDto.getFileAbsolutePath()))) { Files.getFileExtension(updateFileDto.getFileAbsolutePath()))) {
throw new ServiceException("file extension cannot not change"); throw new ServiceException("file extension cannot not change");
} }

Loading…
Cancel
Save