public HttpTemplateDownloader(StorageLayer storageLayer, String downloadUrl, String toDir, DownloadCompleteCallback callback, long maxTemplateSizeInBytes, String user, String password, Proxy proxy, ResourceType resourceType) { _storage = storageLayer; this.downloadUrl = downloadUrl; this.toDir = toDir; this.resourceType = resourceType; this.maxTemplateSizeInBytes = maxTemplateSizeInBytes; completionCallback = callback; status = TemplateDownloader.Status.NOT_STARTED; totalBytes = 0; client = new HttpClient(s_httpClientManager); myretryhandler = createRetryTwiceHandler(); try { request = createRequest(downloadUrl); checkTemporaryDestination(toDir); checkProxy(proxy); checkCredentials(user, password); } catch (Exception ex) { errorString = "Unable to start download -- check url? "; status = TemplateDownloader.Status.UNRECOVERABLE_ERROR; s_logger.warn("Exception in constructor -- " + ex.toString()); } catch (Throwable th) { s_logger.warn("throwable caught ", th); } }