}
public synchronized void get(String url, StreamReceiver receiver, List<Range> rangeList, ProgressListener listener) throws com.ettrema.httpclient.HttpException, Utils.CancelledException, NotAuthorizedException, BadRequestException, ConflictException, NotFoundException {
LogUtils.trace(log, "get: ", url);
notifyStartRequest();
HttpMethodBase m;
if (rangeList != null) {
m = new RangedGetMethod(url, rangeList);
} else {
m = new GetMethod(url);
}
InputStream in = null;
NotifyingFileInputStream nin = null;
try {
int res = client.executeMethod(m);
Utils.processResultCode(res, url);
in = m.getResponseBodyAsStream();
nin = new NotifyingFileInputStream(in, m.getResponseContentLength(), url, listener);
receiver.receive(nin);
} catch (com.dotcms.repackage.org.apache.commons.httpclient.HttpException ex) {
m.abort();
throw new GenericHttpException(ex.getReasonCode(), url);
} catch (Utils.CancelledException ex) {
m.abort();
throw ex;
} catch (IOException ex) {
m.abort();
throw new RuntimeException(ex);
} finally {
Utils.close(in);
m.releaseConnection();
notifyFinishRequest();
}
}