Commons IO
  1. Commons IO
  2. IO-190

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 2.0
    • Component/s: Utilities
    • Labels:
      None
    • Environment:

      Windows XP

      Description

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

      1. IO-190.patch
        4 kB
        Jukka Zitting

        Activity

        Hide
        Jukka Zitting added a comment -

        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.

        Show
        Jukka Zitting added a comment - 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.
        Hide
        Niall Pemberton added a comment -

        Thanks for the patch Jukka - I've applied it

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

        Show
        Niall Pemberton added a comment - Thanks for the patch Jukka - I've applied it http://svn.apache.org/viewvc?view=revision&revision=1002796

          People

          • Assignee:
            Unassigned
            Reporter:
            JPW
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development