SbloodyS commented on code in PR #10675:
URL: https://github.com/apache/dolphinscheduler/pull/10675#discussion_r914357389
##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java:
##########
@@ -175,21 +175,32 @@ 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.isDirectory()) {
+ logger.error("destination file must be a file, but {} is a
folder", dstFilePath);
Review Comment:
> > I think we should delete it instead of throwing exception if `overwrite`
is true.
>
> Ok, by the way ,do I need to throw an error if the path is a directory and
the overwrite if false
There is no need to verify it if it's false.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]