/** * @return 'True' if the operation was executed and at least one redirection was followed. */ public boolean wasRedirected() { return (mRedirectionPath != null && mRedirectionPath.getRedirectionsCount() > 0); }
public RedirectionPath followRedirection(HttpMethod method) throws IOException { int redirectionsCount = 0; int status = method.getStatusCode(); RedirectionPath result = new RedirectionPath(status, MAX_REDIRECTIONS_COUNT); while (redirectionsCount < MAX_REDIRECTIONS_COUNT && ( status == HttpStatus.SC_MOVED_PERMANENTLY || result.addLocation(locationStr); result.addStatus(status); redirectionsCount++;
public int executeHttpMethod (HttpBaseMethod method) throws Exception { boolean repeatWithFreshCredentials; int repeatCounter = 0; int status; do { setRequestId(method); status = method.execute(); checkFirstRedirection(method); if(mFollowRedirects && !isIdPRedirection()) { status = followRedirection(method).getLastStatus(); } repeatWithFreshCredentials = checkUnauthorizedAccess(status, repeatCounter); if (repeatWithFreshCredentials) { repeatCounter++; } } while (repeatWithFreshCredentials); return status; }
public RedirectionPath followRedirection(HttpBaseMethod method) throws Exception { int redirectionsCount = 0; int status = method.getStatusCode(); RedirectionPath redirectionPath = new RedirectionPath(status, MAX_REDIRECTIONS_COUNT); "Location to redirect: " + location); redirectionPath.addLocation(location); redirectionPath.addStatus(status); redirectionsCount++;
status = followRedirection(method).getLastStatus();
status = mRedirectionPath.getLastStatus();
/** * @return 'True' if the operation was executed and at least one redirection was followed. */ public boolean wasRedirected() { return (mRedirectionPath != null && mRedirectionPath.getRedirectionsCount() > 0); } }
if (previousFollowRedirects) { mRedirectionPath = client.followRedirection(head); status = mRedirectionPath.getLastStatus();