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

Add support for moving a file to an existing path if the existing file is zero bytes in size -- org.apache.commons.io.FileUtils#moveFile(File, File)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.4
    • 2.0
    • Utilities
    • None

    Description

      Howdy,

      org.apache.commons.io.FileUtils#moveFile(File, File) currently throws an IOException if the destination File already exists. IMHO this is the expected behavior in cases where the destination file has is at least one byte in size. But in some cases the user might want to create a file before calling this method to be sure it was created successfully and use another filename if not. Since a generic IOException is thrown in cases where the destination file does already exist a user not able to implement counter-measures for such cases. So i suggest to add another method for this case.

      Attachments

        Activity

          People

            niallp Niall Pemberton
            malax Manuel Giesa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: