|
|
@ -447,11 +447,11 @@ public class HTTPClient {
|
|
|
|
byte[] content = null;
|
|
|
|
byte[] content = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
execute(httpUriRequest);
|
|
|
|
execute(httpUriRequest);
|
|
|
|
if (httpResponse == null || httpResponse.getStatusLine().getStatusCode() != 200) return null;
|
|
|
|
if (httpResponse == null) return null;
|
|
|
|
// get the response body
|
|
|
|
// get the response body
|
|
|
|
final HttpEntity httpEntity = httpResponse.getEntity();
|
|
|
|
final HttpEntity httpEntity = httpResponse.getEntity();
|
|
|
|
if (httpEntity != null) {
|
|
|
|
if (httpEntity != null) {
|
|
|
|
if (httpEntity.getContentLength() < maxBytes) {
|
|
|
|
if (getStatusCode() == 200 && httpEntity.getContentLength() < maxBytes) {
|
|
|
|
content = EntityUtils.toByteArray(httpEntity);
|
|
|
|
content = EntityUtils.toByteArray(httpEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// TODO: The name of this method is misnomer.
|
|
|
|
// TODO: The name of this method is misnomer.
|
|
|
|