[
https://issues.apache.org/jira/browse/IO-695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17267745#comment-17267745
]
Dominik Derwiński commented on IO-695:
--------------------------------------
{noformat}
* <strong>Note:</strong> Setting <code>preserveFileDate</code> 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
* will succeed. If the modification operation fails, the methods throws
IOException.
{noformat}
Guess I'll have to settle with just corrected javadoc. But it's still an
improvement, when you can't be nastily surprised by undocumented exception,
right?
> Exception while there should be none in copyFile
> ------------------------------------------------
>
> Key: IO-695
> URL: https://issues.apache.org/jira/browse/IO-695
> Project: Commons IO
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.8.0
> Reporter: Dominik Derwiński
> Priority: Minor
>
> {{public static void copyFile(final File srcFile, final File destFile, final
> boolean preserveFileDate)}} java doc says: "If the modification operation
> fails, no indication is provided", yet the method raises an {{IOException}}
> "Failed setLastModified on ...".
--
This message was sent by Atlassian Jira
(v8.3.4#803005)