[ 
https://issues.apache.org/jira/browse/IO-215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Niall Pemberton updated IO-215:
-------------------------------

    Attachment: IO-215-copy-option-v3.patch

Attaching IO-215-copy-option-v3.patch that fixes the javadoc errors and adds 
FileUtils.copyFileToDirectory(File, File, CopyOption) method.

I don't like  if (!xxx()) - I think if (xxx() == false)  is better. I guess we 
disagree on this style.

Currently as this stands the copyDirectory() implementation when called with 
CopyOption.PreserveDatesThrowError will throw an error when the first 
File.setLastModified(long) operation fails. This could leave the copy operation 
in an inconsistent state with the directory only partially copied. IMO I think 
it would be better to complete the copy operation and throw an exception at the 
end. WDYT?

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

Reply via email to