download file exception handling

Posted by klaus-vlad on Stack Overflow See other posts from Stack Overflow or by klaus-vlad
Published on 2010-04-23T09:31:38Z Indexed on 2010/04/23 9:53 UTC
Read the original article Hit count: 220

Filed under:

Hi,

In my application I download several critical files from a server, and I want to write some code that handles the case where the a file download didn't complete for a reason or other ,to retry downloading it at next startup. The function that downloads a file at a time however throws only MalformedURLException and IOException , but if these exceptions are thrown that means that the download didn't even begin. How should I arrange things so I can treat the case where a download failed , even if it began ?

download(String file) throws MalformedURLException ,IOException 
{

}

© Stack Overflow or respective owner

Related posts about java