You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/06/14 14:15:03 UTC
[commons-io] branch master updated: [IO-769] FileUtils.copyFileToDirectory can lead to not accessible file when preserving the file date
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push:
new 64fb4dda [IO-769] FileUtils.copyFileToDirectory can lead to not accessible file when preserving the file date
64fb4dda is described below
commit 64fb4dda76ecdebfd77ab4df5928f34e4b2dc486
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jun 14 10:14:57 2022 -0400
[IO-769] FileUtils.copyFileToDirectory can lead to not accessible file
when preserving the file date
Update Javadoc
---
src/main/java/org/apache/commons/io/FileUtils.java | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/FileUtils.java b/src/main/java/org/apache/commons/io/FileUtils.java
index f5a04f16..6bda85a4 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -745,7 +745,7 @@ public class FileUtils {
* </p>
* <p>
* <strong>Note:</strong> This method tries to preserve the file's last modified date/times using
- * {@link File#setLastModified(long)}, however it is not guaranteed that the operation will succeed. If the
+ * {@link StandardCopyOption#COPY_ATTRIBUTES}, however it is not guaranteed that the operation will succeed. If the
* modification operation fails, the methods throws IOException.
* </p>
*
@@ -771,7 +771,7 @@ public class FileUtils {
* </p>
* <p>
* <strong>Note:</strong> Setting {@code preserveFileDate} to {@code true} tries to preserve the file's last
- * modified date/times using {@link File#setLastModified(long)}, however it is not guaranteed that the operation
+ * modified date/times using {@link StandardCopyOption#COPY_ATTRIBUTES}, however it is not guaranteed that the operation
* will succeed. If the modification operation fails, the methods throws IOException.
* </p>
*
@@ -801,7 +801,7 @@ public class FileUtils {
* </p>
* <p>
* <strong>Note:</strong> Setting {@code preserveFileDate} to {@code true} tries to preserve the file's last
- * modified date/times using {@link File#setLastModified(long)}, however it is not guaranteed that the operation
+ * modified date/times using {@link StandardCopyOption#COPY_ATTRIBUTES}, however it is not guaranteed that the operation
* will succeed. If the modification operation fails, the methods throws IOException.
* </p>
*
@@ -886,7 +886,7 @@ public class FileUtils {
* </p>
* <p>
* <strong>Note:</strong> This method tries to preserve the file's last modified date/times using
- * {@link File#setLastModified(long)}, however it is not guaranteed that the operation will succeed. If the
+ * {@link StandardCopyOption#COPY_ATTRIBUTES}, however it is not guaranteed that the operation will succeed. If the
* modification operation fails, the methods throws IOException.
* </p>
*
@@ -910,7 +910,7 @@ public class FileUtils {
* </p>
* <p>
* <strong>Note:</strong> Setting {@code preserveFileDate} to {@code true} tries to preserve the file's last
- * modified date/times using {@link File#setLastModified(long)}, however it is not guaranteed that the operation
+ * modified date/times using {@link StandardCopyOption#COPY_ATTRIBUTES}, however it is not guaranteed that the operation
* will succeed. If the modification operation fails, the methods throws IOException.
* </p>
*
@@ -963,13 +963,14 @@ public class FileUtils {
* specified destination directory.
* </p>
* <p>
- * The destination directory is created if it does not exist. If the destination directory did exist, then this
- * method merges the source with the destination, with the source taking precedence.
+ * The destination directory is created if it does not exist. If the destination directory did exist, then this method
+ * merges the source with the destination, with the source taking precedence.
* </p>
* <p>
* <strong>Note:</strong> This method tries to preserve the files' last modified date/times using
- * {@link File#setLastModified(long)}, however it is not guaranteed that those operations will succeed. If the
- * modification operation fails, the methods throws IOException.
+ * {@link StandardCopyOption#COPY_ATTRIBUTES} or {@link File#setLastModified(long)} depending on the input, however it
+ * is not guaranteed that those operations will succeed. If the modification operation fails, the methods throws
+ * IOException.
* </p>
*
* @param sourceFile an existing file or directory to copy, must not be {@code null}.