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

Add timeout (connection and read) support for FileUtils.copyURLToFile

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • Utilities
    • None

    Description

      The copyURLToFile(URL source, File destination) method in FileUtils uses source.openStream() to obtain an input stream for the URL. Unfortunately the openStream() method does not set any connection or read timeouts and might cause applications to hang if they're downloading files using this method. My patch adds another method (a second method to keep backwards compatibility) copyURLToFile(URL source, File destination, int connectionTimeout, int readTimeout) to let define those timeouts.

      Attachments

        1. copyURLToFile_with_timeouts.diff
          3 kB
          Oliver Siegmar

        Activity

          People

            niallp Niall Pemberton
            ojs Oliver Siegmar
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: