bogthe commented on a change in pull request #3101:
URL: https://github.com/apache/hadoop/pull/3101#discussion_r671257936



##########
File path: 
hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md
##########
@@ -1419,6 +1419,75 @@ operations related to the part of the file being 
truncated is undefined.
 
 
 
+### `boolean copyFromLocalFile(boolean delSrc, boolean overwrite, Path src, 
Path dst)`
+
+The source file or directory at `src` is on the local disk and is copied into 
the file system at
+destination `dst`. If the source should be deleted after the move then 
`delSrc` flag needs to be
+set to TRUE. If destination already exists, and the destination contents 
should be overwritten
+then `overwrite` flag should be set to TRUE.
+
+#### Preconditions
+
+The source file or directory must exist:
+
+    if not exists(FS, src) : raise FileNotFoundException
+
+Directories cannot be copied into files regardless to what the overwrite flag 
is set to:
+
+    if isDir(FS, src) && isFile(FS, dst) : raise PathExistsException
+
+If destination exists and the above precondition holds then the overwrite flag 
must be set to TRUE

Review comment:
       Bad wording on my part; the `above precondition` was referring to the 
fact that `Directories cannot be copied into files regardless to what the 
overwrite flag is set to`, so what the sentence should say is: `For all cases, 
except the one for which the above precondition throws an exception, the 
overwrite flag must be set to TRUE for the operation to succeed. This will also 
overwrite any files / directories at the destination.`




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to