commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <>
Subject [jira] Resolved: (IO-208) Add timeout (connection and read) support for FileUtils.copyURLToFile
Date Wed, 08 Sep 2010 15:00:37 GMT


Niall Pemberton resolved IO-208.

         Assignee: Niall Pemberton
    Fix Version/s: 2.0
       Resolution: Fixed

Thanks for the patch - I modified it slightly, refactoring the code to delegate to a new method

> Add timeout (connection and read) support for FileUtils.copyURLToFile
> ---------------------------------------------------------------------
>                 Key: IO-208
>                 URL:
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>            Reporter: Oliver Siegmar
>            Assignee: Niall Pemberton
>             Fix For: 2.0
>         Attachments: copyURLToFile_with_timeouts.diff
> 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.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message