tza commented on a change in pull request #185:
URL: https://github.com/apache/commons-io/pull/185#discussion_r555985076



##########
File path: src/main/java/org/apache/commons/io/FileUtils.java
##########
@@ -2172,12 +2177,39 @@ public static void moveDirectoryToDirectory(final File 
src, final File destDir,
      * @since 1.4
      */
     public static void moveFile(final File srcFile, final File destFile) 
throws IOException {
+        moveFile(srcFile, destFile, true);
+    }
+
+    /**
+     * Moves a file.
+     * <p>
+     * When the destination file is on another file system, do a "copy and 
delete".
+     * </p>
+     * <p>
+     * <strong>Note:</strong> Setting <code>preserveFileDate</code> to {@code 
true} tries to preserve the files' last
+     * modified date/times using {@link File#setLastModified(long)} when 
destination is another file system, however it
+     * is not guaranteed that those operations will succeed. If the 
modification operation fails, the methods throws
+     * IOException.
+     * </p>
+     *
+     * @param srcFile the file to be moved.
+     * @param destFile the destination file.
+     * @param preserveFileDate true if the file date of the "copy and delete" 
should be the same as the original when
+     *            destination is on another file system. Param is not used if 
destination is on same file system.
+     * @throws NullPointerException if any of the given {@code File}s are 
{@code null}.
+     * @throws FileExistsException if the destination file exists.
+     * @throws IOException if source or destination is invalid.
+     * @throws IOException if an error occurs or setting the last-modified 
time didn't succeeded.
+     * @since 1.4

Review comment:
       Rebased and fixed since tag.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to