res = httpClient.execute(req);
}
statusCode = res.getStatusLine().getStatusCode();
} catch(IOException e) {
// Automatically released in case of IOException
throw new HttpGetException(e);
} catch(RuntimeException e) {
req.abort();
throw new HttpGetException(e);
}
if(statusCode != 200) {
// Needed to consume the rest of the response and release the connection
EntityUtils.consumeQuietly(res.getEntity());
throw new HttpGetException(res.getStatusLine().getReasonPhrase(), statusCode);
}
return res;
}