sunithabeeram commented on a change in pull request #3671: Make different
PinotFS concrete classes have the same behaviors
URL: https://github.com/apache/incubator-pinot/pull/3671#discussion_r246850076
##########
File path:
pinot-filesystem/src/main/java/com/linkedin/pinot/filesystem/LocalPinotFS.java
##########
@@ -97,7 +97,8 @@ public boolean move(URI srcUri, URI dstUri, boolean
overwrite) throws IOExceptio
public boolean copy(URI srcUri, URI dstUri) throws IOException {
File srcFile = new File(decodeURI(srcUri.getRawPath()));
File dstFile = new File(decodeURI(dstUri.getRawPath()));
- if (dstFile.exists()) {
+ // delete dst only if dst isn't under src.
+ if (!dstFile.getCanonicalPath().startsWith(srcFile.getCanonicalPath()) &&
dstFile.exists()) {
Review comment:
Is it valid to delete dst if its a directory?
If someone attempts to copy name1 to dst/name1, where the source name1 is a
directory and dst/name1 is a file, shouldn't the copy fail?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]