log.info(format("Download from %s returned with status code %s", download.getUrl(), get.getStatusCode()));
if (get.isSuccessful() && inputStream != null) {
if(contentLength == null)
contentLength = get.getContentLength();
modelUpdater.expectingBytes(contentLength != null ? contentLength : 0);
new Copier(modelUpdater).copyAndClose(inputStream, new FileOutputStream(download.getTempFile()), 0, contentLength);
download.setETag(get.getETag());
return true;
}
return false;
}