Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-769

FileUtils.copyFileToDirectory can lead to not accessible file when preserving the file date

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.11.0
    • 2.12.0
    • Utilities
    • None

    Description

      Hi,

      The current implementation for copyFileToDirectory by default preserve the file. 

      There 2 issues regarding this:

      • the javadoc mentions this is done by File.setLastModified by in fact this is done by the COPY_ATTRIBUTES options
      • Under Windows, the COPY_ATTRIBUTES also copies the security attributes (SID and permissions) and can lead to a file not beeing readable after copy (if for example, you copie from a mount under docker or a shared folder)

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jcarnus Jérémy Carnus
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m