[
https://issues.apache.org/jira/browse/IO-215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910642#action_12910642
]
Sebb commented on IO-215:
-------------------------
Agreed that failing part-way through a dir copy is not ideal.
If the private file and dir methods were changed to return false if any
setLastModified fails, and true otherwise, then it should be easy to throw the
appropriate error at the end.
Or better yet, the private doCopyDirectory method could return the File that
failed, otherwise null. This would allow the Exception to identify the file
which caused the first failure.
> FileUtils copy methods swallow date modification failures
> ---------------------------------------------------------
>
> Key: IO-215
> URL: https://issues.apache.org/jira/browse/IO-215
> Project: Commons IO
> Issue Type: Bug
> Components: Utilities
> Reporter: Sebb
> Attachments: IO-215-copy-option-v3.patch
>
>
> FileUtils.doCopyDirectory(..) and .FileUtils.doCopyFile(..) both call the
> setLastModified() method, but fail to check if it succeeded or not.
> Surely if the caller has asked for the date to be preserved, failure to do so
> should be reported somehow?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.