case HttpStatus.SC_TEMPORARY_REDIRECT: {
lRedirect = true;
// The redirection code fails for
// localhost, use IP address as a workaround.
String redirectLocation;
Header locationHeader = gMethod
.getResponseHeader("location");
if (locationHeader != null) {
redirectLocation = locationHeader.getValue();
gMethod.setFollowRedirects(true);
lUrl = new URL(redirectLocation);
} else {
}
}
break;
case HttpStatus.SC_PARTIAL_CONTENT:
// sLog.info("(1) Partial download granted for: "
// + pUrl.toExternalForm());
// sLog.info("(2) Start at byte: "
// + gMethod.getRequestHeader("Range")
// .getValue());
lContinue = false;
break;
case HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE: {
// 28-07-2006, Duh? OK let's try again without
// Range.
// sLog.warn("(1) Partial download denied for: "
// + pUrl.toExternalForm());
Header lRHeader = gMethod
.getResponseHeader("Content-Range");
if (lRHeader != null) {
// sLog.warn("(2) The content-range is: "
// + lRHeader.getValue());
}
// sLog.warn(gMethod.getResponseBodyAsString());
Header h = gMethod.getRequestHeader("Range");
gMethod.removeRequestHeader(h);
append = false;
}
break;
case HttpStatus.SC_UNAUTHORIZED: {