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

FileUtils.moveFile(File, File) can cause IOException in Windows.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.11.0
    • 2.12.0
    • Utilities
    • None
    • Windows

    Description

      Hi,

      This report is spawn from a bug found in commons-fileupload:1.4 and up.

       

      https://issues.apache.org/jira/browse/FILEUPLOAD-338

       

      The code at this line:

      https://github.com/apache/commons-io/blob/f22a4227401855ecbfdf8184bbe37275c3aeb5c3/src/main/java/org/apache/commons/io/FileUtils.java#L2392

       

      can cause IOException when the .tmp file is deleted during the writing the upload file to disk.

      We found that the java process holding on to the open handler of the .tmp file (during the read for writing to the destination file); thus the delete() operation fails and the IOException is thrown.

       

      This problem only happens on Windows.

       

      Thanks,

      Attachments

        Activity

          People

            Unassigned Unassigned
            pmdinh Phu Dinh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: