Code example for DefaultHttpRequestRetryHandler

0
	private <T> T download(URI uri, ResponseHandler<T> responseHandler,
			int maxRetries) throws ClientProtocolException, IOException {
		try { 
			DefaultHttpClient client = new DefaultHttpClient();
			client.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(
					maxRetries, false));
 
			HttpRequest request = new HttpGet(uri);
 
			return client.execute((HttpUriRequest) request, responseHandler);
		} catch (IOException ex) {
			throw ex;
		} 
	} 
 
	/* 
	 * (non-Javadoc) 
	 *  
	 * @see 
	 * de.dan_nrw.boobleftboobright.IWallpaperManager#downloadImage(java.net 
	 * .URI)