public class SocialHttpClientSupport extends Object
| Constructor and Description |
|---|
SocialHttpClientSupport() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildCommonRestPathFromContext(boolean isPrivate)
Builds the common rest path from the context.
|
static void |
consume(org.apache.http.HttpEntity entity)
Checks the entity and close InputStream
|
static byte[] |
convertModelToByteArray(Model model)
Gets the byte array from Model object which provides to HttpPost to Rest Service.
|
static void |
dumpContent(org.apache.http.HttpResponse response)
Dump the HttpResponse content which Rest Service to return.
|
static void |
dumpHttpResponsetHeader(org.apache.http.HttpResponse response)
Dump the HttpResponse's header which Rest Service to return.
|
static org.apache.http.HttpResponse |
executeDelete(String targetURL,
SocialHttpClient.POLICY authPolicy)
Invokes the social rest service via Delete method with HttpParams is null.
|
static org.apache.http.HttpResponse |
executeDelete(String targetURL,
SocialHttpClient.POLICY authPolicy,
org.apache.http.params.HttpParams params)
Invokes the social rest service via Delete method with HttpParams
|
static org.apache.http.HttpResponse |
executeGet(String targetURL,
SocialHttpClient.POLICY authPolicy)
Invokes the social rest service via Get method
|
static org.apache.http.HttpResponse |
executeGet(String targetURL,
SocialHttpClient.POLICY authPolicy,
org.apache.http.params.HttpParams params)
Invokes the social rest service via Get method
|
static org.apache.http.HttpResponse |
executePost(String targetURL,
SocialHttpClient.POLICY authPolicy)
Invokes the social rest service via Post but both
Model and HttpParams are null. |
static org.apache.http.HttpResponse |
executePost(String targetURL,
SocialHttpClient.POLICY authPolicy,
org.apache.http.params.HttpParams params)
Invokes the social rest service via Post method with
Model and HttpParams is null. |
static org.apache.http.HttpResponse |
executePost(String targetURL,
SocialHttpClient.POLICY authPolicy,
org.apache.http.params.HttpParams params,
Model model)
Invokes the social rest service via Post method
|
static org.apache.http.HttpResponse |
executePost(String targetURL,
SocialHttpClient.POLICY authPolicy,
Model model)
Invokes the social rest service via Post method with
Model is null and HttpParams. |
static String |
getContent(org.apache.http.HttpResponse response)
Executes the HttpResponse with read the content to buffered.
|
static void |
handleError(org.apache.http.HttpResponse response)
Handles the error code which contains in HttpResponse.
|
static void |
handleErrorWithRedirect(org.apache.http.HttpResponse response) |
static org.apache.http.HttpEntity |
processContent(org.apache.http.HttpResponse response)
Executes the HttpResponse with read the content to buffered.
|
public static org.apache.http.HttpResponse executeGet(String targetURL, SocialHttpClient.POLICY authPolicy, org.apache.http.params.HttpParams params) throws SocialHttpClientException
targetURL - authPolicy - POLICY.NO_AUTH/POLICY.BASIC_AUTHparams - HttpParams for RequestIOExceptionorg.apache.http.client.ClientProtocolExceptionSocialHttpClientExceptionpublic static org.apache.http.HttpResponse executeGet(String targetURL, SocialHttpClient.POLICY authPolicy) throws SocialHttpClientException
targetURL - authPolicy - POLICY.NO_AUTH/POLICY.BASIC_AUTHIOExceptionorg.apache.http.client.ClientProtocolExceptionSocialHttpClientExceptionpublic static org.apache.http.HttpResponse executePost(String targetURL, SocialHttpClient.POLICY authPolicy, org.apache.http.params.HttpParams params, Model model) throws SocialHttpClientException
targetURL - authPolicy - POLICY.NO_AUTH/POLICY.BASIC_AUTHparams - HttpParams for RequestIOExceptionorg.apache.http.client.ClientProtocolExceptionSocialHttpClientExceptionpublic static org.apache.http.HttpResponse executePost(String targetURL, SocialHttpClient.POLICY authPolicy, org.apache.http.params.HttpParams params) throws SocialHttpClientException
Model and HttpParams is null.targetURL - authPolicy - POLICY.NO_AUTH/POLICY.BASIC_AUTHparams - HttpParams for RequestIOExceptionorg.apache.http.client.ClientProtocolExceptionSocialHttpClientExceptionpublic static org.apache.http.HttpResponse executePost(String targetURL, SocialHttpClient.POLICY authPolicy, Model model) throws SocialHttpClientException
Model is null and HttpParams.targetURL - authPolicy - POLICY.NO_AUTH/POLICY.BASIC_AUTHIOExceptionorg.apache.http.client.ClientProtocolExceptionSocialHttpClientExceptionpublic static org.apache.http.HttpResponse executePost(String targetURL, SocialHttpClient.POLICY authPolicy) throws SocialHttpClientException
Model and HttpParams are null.targetURL - authPolicy - POLICY.NO_AUTH/POLICY.BASIC_AUTHSocialHttpClientExceptionpublic static org.apache.http.HttpResponse executeDelete(String targetURL, SocialHttpClient.POLICY authPolicy, org.apache.http.params.HttpParams params) throws SocialHttpClientException
targetURL - authPolicy - POLICY.NO_AUTH/POLICY.BASIC_AUTHparams - HttpParams for RequestIOExceptionorg.apache.http.client.ClientProtocolExceptionSocialHttpClientExceptionpublic static org.apache.http.HttpResponse executeDelete(String targetURL, SocialHttpClient.POLICY authPolicy) throws SocialHttpClientException
targetURL - authPolicy - POLICY.NO_AUTH/POLICY.BASIC_AUTHIOExceptionorg.apache.http.client.ClientProtocolExceptionSocialHttpClientExceptionpublic static byte[] convertModelToByteArray(Model model) throws IOException
model - Model objectIOExceptionpublic static org.apache.http.HttpEntity processContent(org.apache.http.HttpResponse response)
throws SocialHttpClientException
response - HttpResponse to process.IllegalStateExceptionIOExceptionSocialHttpClientExceptionpublic static String getContent(org.apache.http.HttpResponse response) throws SocialHttpClientException
response - HttpResponse to process.IllegalStateExceptionIOExceptionSocialHttpClientExceptionpublic static void consume(org.apache.http.HttpEntity entity)
throws IllegalStateException,
IOException
entity - IllegalStateExceptionIOExceptionpublic static String buildCommonRestPathFromContext(boolean isPrivate)
isPrivate - indicates is the url needs authentication access.public static void handleError(org.apache.http.HttpResponse response)
throws SocialClientLibException
response - HttpResponseSocialClientLibExceptionSocialHttpClientExceptionpublic static void handleErrorWithRedirect(org.apache.http.HttpResponse response)
throws SocialClientLibException,
RedirectException
public static void dumpHttpResponsetHeader(org.apache.http.HttpResponse response)
response - public static void dumpContent(org.apache.http.HttpResponse response)
throws SocialHttpClientException
response - Entity to dumporg.apache.http.ParseExceptionIOExceptionSocialHttpClientExceptionCopyright © 2011–2015 eXo Platform SAS. All rights reserved.