You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/06/29 13:54:56 UTC

[GitHub] [dolphinscheduler] sketchmind commented on a diff in pull request #10676: [Fix-10665][Worker] Tasks with S3 resource files failed incorrectly

sketchmind commented on code in PR #10676:
URL: https://github.com/apache/dolphinscheduler/pull/10676#discussion_r909666401


##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java:
##########
@@ -175,7 +176,21 @@ public String getFileName(ResourceType resourceType, String tenantCode, String f
     }
 
     @Override
-    public void download(String tenantCode, String srcFilePath, String dstFile, boolean deleteSource, boolean overwrite) throws IOException {
+    public void download(String tenantCode, String srcFilePath, String dstFilePath, boolean deleteSource, boolean overwrite) throws IOException {
+        File dstFile = new File(dstFilePath);
+        if (dstFile.exists()) {
+            if (dstFile.isFile()) {
+                if (overwrite) {
+                    Files.delete(dstFile.toPath());

Review Comment:
   this isn't needed, FileOutputStream will overwrite default



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org