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

Wrong exception message in FileUtils.setLastModified(File, File)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 2.12.0
    • Utilities
    • None
    • Ubuntu 20.04 LTS

      Groovy 3.0.x

      Java 11 (from Ubuntu packages)

    Description

      A simple

      FileUtils.copyDirectory(source, dest, glob) 

      works fine when using Commons-IO 2.7, but fails with

      Caught: java.io.IOException: Failed setLastModified on /path/to/source
      java.io.IOException: Failed setLastModified on /path/to/source
              at org.apache.commons.io.FileUtils.setLastModified(FileUtils.java:2561)
              at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1361)
              at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:733)
              at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:659)
              at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:606)
      

      after update to 2.8.0. From reading the documentation, it's also my understanding that "setLastModified()" should be executed on "dest" to set the same modification time as "source", but not on "source".

      Attachments

        Activity

          People

            Unassigned Unassigned
            Heinrichs Dirk Heinrichs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: