com.stackmob.sdk.net
Class HttpRedirectHelper

java.lang.Object
  extended by com.stackmob.sdk.net.HttpRedirectHelper

public class HttpRedirectHelper
extends Object


Field Summary
static int RedirectStatusCode
           
 
Constructor Summary
HttpRedirectHelper()
           
 
Method Summary
static String getNewLocation(Map<String,String> headers)
          get the new request that represents the redirect if there is one
static boolean isRedirected(int responseCode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RedirectStatusCode

public static final int RedirectStatusCode
See Also:
Constant Field Values
Constructor Detail

HttpRedirectHelper

public HttpRedirectHelper()
Method Detail

getNewLocation

public static String getNewLocation(Map<String,String> headers)
                             throws Exception
get the new request that represents the redirect if there is one

Parameters:
headers - the headers from which to get the new loc
Returns:
the new request to make. NOTE: if a redirect happened, setURI will be called on oldRequest and the result is returned, so your original request will be modified in place.
Throws:
Exception - if there was a problem getting the redirect location
URISyntaxException - if there is a problem parsing the redirect URL

isRedirected

public static boolean isRedirected(int responseCode)


Copyright © 2012 StackMob. All Rights Reserved.