jackjlli 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_r246872261
##########
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:
In your case, src is name1 and dst is dst/name1.
So the condition
`!dstFile.getCanonicalPath().startsWith(srcFile.getCanonicalPath())` is
satisfied and so is`dstFile.exists()`. Thus, the previous dst will be deleted.
----------------------------------------------------------------
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]