You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "JPW (JIRA)" <ji...@apache.org> on 2008/12/30 16:04:44 UTC

[jira] Created: (IO-190) FileUtils.copyDirectory preserves destination subdirectories, rather than overwriting with the source subdirectories

FileUtils.copyDirectory preserves destination subdirectories, rather than overwriting with the source subdirectories
--------------------------------------------------------------------------------------------------------------------

                 Key: IO-190
                 URL: https://issues.apache.org/jira/browse/IO-190
             Project: Commons IO
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 1.4
         Environment: Windows XP
            Reporter: JPW
            Priority: Trivial


When using FileUtils.copyDirectory to copy directories with subdirectories, the source will overwrite all files that exist in the destination directory, but not the subdirectories themselves. The files inside the subdirectories will be overwritten. The only difference that I've noticed thus far is that this preserves the old file dates of the subdirectories rather than using the dates from the source or the current date, if preserveFileDate is set to 'false.'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (IO-190) FileUtils.copyDirectory preserves destination subdirectories, rather than overwriting with the source subdirectories

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved IO-190.
--------------------------------

    Fix Version/s: 2.0
       Resolution: Fixed

Thanks for the patch Jukka - I've applied it

http://svn.apache.org/viewvc?view=revision&revision=1002796

> FileUtils.copyDirectory preserves destination subdirectories, rather than overwriting with the source subdirectories
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: IO-190
>                 URL: https://issues.apache.org/jira/browse/IO-190
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Windows XP
>            Reporter: JPW
>            Priority: Trivial
>             Fix For: 2.0
>
>         Attachments: IO-190.patch
>
>
> When using FileUtils.copyDirectory to copy directories with subdirectories, the source will overwrite all files that exist in the destination directory, but not the subdirectories themselves. The files inside the subdirectories will be overwritten. The only difference that I've noticed thus far is that this preserves the old file dates of the subdirectories rather than using the dates from the source or the current date, if preserveFileDate is set to 'false.'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IO-190) FileUtils.copyDirectory preserves destination subdirectories, rather than overwriting with the source subdirectories

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated IO-190:
-----------------------------

    Attachment: IO-190.patch

I guess it's no problem whether or not the target directory dates change when preserveFileDate is false. Or is it?

Anyway, when the preserveFileDate argument is *true*, then the dates of also the target directories and not just the files contained in them should probably be set. The attached patch implements this change.

I'm not sure if there's some good reason why this shouldn't be done, so please review before I commit this.

> FileUtils.copyDirectory preserves destination subdirectories, rather than overwriting with the source subdirectories
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: IO-190
>                 URL: https://issues.apache.org/jira/browse/IO-190
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Windows XP
>            Reporter: JPW
>            Priority: Trivial
>         Attachments: IO-190.patch
>
>
> When using FileUtils.copyDirectory to copy directories with subdirectories, the source will overwrite all files that exist in the destination directory, but not the subdirectories themselves. The files inside the subdirectories will be overwritten. The only difference that I've noticed thus far is that this preserves the old file dates of the subdirectories rather than using the dates from the source or the current date, if preserveFileDate is set to 'false.'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.