Bug 223185 - HttpClientRetrieveFileTransfer and FileNotFoundException
Summary: HttpClientRetrieveFileTransfer and FileNotFoundException
Status: CLOSED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.filetransfer (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: ecf.core-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-03-19 08:13 EDT by Thomas Hallgren CLA
Modified: 2008-05-18 20:07 EDT (History)
1 user (show)

See Also:


Attachments
Patch with special treatment for 404 errors (1.94 KB, patch)
2008-03-19 08:13 EDT, Thomas Hallgren CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hallgren CLA 2008-03-19 08:13:41 EDT
Created attachment 92900 [details]
Patch with special treatment for 404 errors

Hi,
It is often beneficial to be able to distinguish between a FileNotFoundException and other IOExceptions. The fact that some artifact cannot be found in some remote repository is semantically different from errors caused by network problems or issues with security and proxies.

The HttpClientRetrieveFileTransfer could easily cater for this by checking the return code for 404's and when they occur, throw a FileNotFoundException instead of the more generic IOException. I believe that the URLConnectionRetrieveFileTransfer already implicitly does this by using urlConnection.getInputStream();

The attached patch will add special treatment for 404 errors to the openStreams() and openStreamsForResume() methods.
Comment 1 Scott Lewis CLA 2008-03-19 10:57:14 EDT
Will do this this week.
Comment 2 Scott Lewis CLA 2008-03-19 11:12:50 EDT
Patch applied, tested for regression and committed to HEAD.  IP log updated. Thanks Thomas.  
Comment 3 Scott Lewis CLA 2008-05-18 20:07:57 EDT
closing.