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

Add FileUtils.moveFile(srcFile, dstFile, CopyOption...)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.9.0
    • Component/s: None
    • Labels:
      None

      Description

      The current implementation 2.8.0 throws an Exception, if moveFiles or copyFiles (with preserveFileDate=true) cannot update the lastModifiedDate. This was not the case in 2.6.

       

      For FileUtils.moveFile the copyFile(File, File) method is used, which results in a copy with preserveFileDate=true. Could you provide a method overload to moveFile similiar to copyFile.

       

      public static void moveFile(final File srcFile, final File destFile) throws IOException {
        moveFile(srcFile, destFile, true);
      }
      
      public static void moveFile(final File srcFile, final File destFile, boolean preserveFileDate) throws IOException {
        ...
        copyFile(srcFile, destFile, preserveFileDate);
      }
      
      

       

      (We have a cifs mount where the server is not allowing the update)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tproko tza
            • Votes:
              0 Vote for this issue
              Watchers:
              2 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