public final class DavGatewayHttpClientFacade extends Object
Modifier and Type | Field and Description |
---|---|
static String |
IE_USER_AGENT |
Modifier and Type | Method and Description |
---|---|
static boolean |
acceptsNTLMOnly(org.apache.commons.httpclient.HttpMethod getMethod)
Test method header for supported authentication mode,
return true if Basic authentication is not available
|
static void |
addNTLM(org.apache.commons.httpclient.HttpClient httpClient)
Enable NTLM authentication on http client
|
static org.apache.http.client.HttpResponseException |
buildHttpResponseException(org.apache.commons.httpclient.HttpMethod method)
Build Http Exception from method status
|
static void |
close(org.apache.commons.httpclient.HttpClient httpClient)
Make sure we close all connections immediately after a session creation failure.
|
static void |
configureClient(org.apache.commons.httpclient.HttpClient httpClient,
String url)
Update http client configuration (proxy)
|
static void |
createMultiThreadedHttpConnectionManager(org.apache.commons.httpclient.HttpClient httpClient)
Create and set connection pool.
|
static int |
executeDeleteMethod(org.apache.commons.httpclient.HttpClient httpClient,
String path)
Execute a delete method on the given path with httpClient.
|
static org.apache.commons.httpclient.HttpMethod |
executeFollowRedirects(org.apache.commons.httpclient.HttpClient httpClient,
org.apache.commons.httpclient.HttpMethod method)
Execute method with httpClient, follow 30x redirects.
|
static org.apache.commons.httpclient.HttpMethod |
executeFollowRedirects(org.apache.commons.httpclient.HttpClient httpClient,
String url)
Execute given url, manually follow redirects.
|
static void |
executeGetMethod(org.apache.commons.httpclient.HttpClient httpClient,
org.apache.commons.httpclient.methods.GetMethod method,
boolean followRedirects)
Execute Get method, do not follow redirects.
|
static int |
executeHttpMethod(org.apache.commons.httpclient.HttpClient httpClient,
org.apache.commons.httpclient.HttpMethod method)
Execute method with httpClient.
|
static org.apache.jackrabbit.webdav.MultiStatusResponse[] |
executeMethod(org.apache.commons.httpclient.HttpClient httpClient,
org.apache.jackrabbit.webdav.client.methods.DavMethodBase method)
Execute webdav request.
|
static org.apache.jackrabbit.webdav.MultiStatusResponse[] |
executeMethod(org.apache.commons.httpclient.HttpClient httpClient,
ExchangeDavMethod method)
Execute webdav request.
|
protected static int |
executeMethodFollowRedirectOnce(org.apache.commons.httpclient.HttpClient httpClient,
org.apache.commons.httpclient.HttpMethod method)
Execute method, redirect once if returned status is redirect.
|
static int |
executeNoRedirect(org.apache.commons.httpclient.HttpClient httpClient,
org.apache.commons.httpclient.HttpMethod method)
Execute method with httpClient, do not follow 30x redirects.
|
static org.apache.jackrabbit.webdav.MultiStatusResponse[] |
executePropFindMethod(org.apache.commons.httpclient.HttpClient httpClient,
String path,
int depth,
org.apache.jackrabbit.webdav.property.DavPropertyNameSet properties)
Execute webdav propfind method.
|
static org.apache.jackrabbit.webdav.MultiStatusResponse[] |
executeSearchMethod(org.apache.commons.httpclient.HttpClient httpClient,
String path,
String searchRequest,
int maxCount)
Execute webdav search method.
|
static int |
executeTestMethod(org.apache.commons.httpclient.HttpClient httpClient,
org.apache.commons.httpclient.methods.GetMethod method)
Execute test method from checkConfig, with proxy credentials, but without Exchange credentials.
|
static int |
getHttpStatus(org.apache.commons.httpclient.HttpClient httpClient,
String url)
Get Http Status code for the given URL
|
static org.apache.commons.httpclient.HttpClient |
getInstance(String url)
Create a configured HttpClient instance.
|
static String |
getUserAgent() |
static boolean |
hasNTLMorNegotiate(org.apache.commons.httpclient.HttpClient httpClient)
Test if NTLM auth scheme is enabled.
|
static boolean |
isGzipEncoded(org.apache.commons.httpclient.HttpMethod method)
Test if the method response is gzip encoded
|
protected static boolean |
isNoProxyFor(URI uri) |
static boolean |
isRedirect(int status)
Check if status is a redirect (various 30x values).
|
static void |
setClientHost(org.apache.commons.httpclient.HttpClient httpClient,
String url)
Set http client current host configuration.
|
static void |
setCredentials(org.apache.commons.httpclient.HttpClient httpClient,
String userName,
String password)
Set credentials on HttpClient instance.
|
static void |
start()
Create and start a new HttpConnectionManager, close idle connections every minute.
|
static void |
stop()
Stop HttpConnectionManager.
|
public static final String IE_USER_AGENT
public static org.apache.commons.httpclient.HttpClient getInstance(String url) throws DavMailException
url
- target urlDavMailException
- on errorpublic static void setCredentials(org.apache.commons.httpclient.HttpClient httpClient, String userName, String password)
httpClient
- httpClient instanceuserName
- user namepassword
- user passwordpublic static void setClientHost(org.apache.commons.httpclient.HttpClient httpClient, String url) throws DavMailException
httpClient
- current Http clienturl
- target urlDavMailException
- on errorprotected static boolean isNoProxyFor(URI uri)
public static void configureClient(org.apache.commons.httpclient.HttpClient httpClient, String url) throws DavMailException
httpClient
- current Http clienturl
- target urlDavMailException
- on errorpublic static void close(org.apache.commons.httpclient.HttpClient httpClient)
httpClient
- http client to closepublic static int getHttpStatus(org.apache.commons.httpclient.HttpClient httpClient, String url)
httpClient
- httpClient instanceurl
- url stringpublic static boolean isRedirect(int status)
status
- Http statuspublic static org.apache.commons.httpclient.HttpMethod executeFollowRedirects(org.apache.commons.httpclient.HttpClient httpClient, String url) throws IOException
httpClient
- HttpClient instanceurl
- url stringIOException
- on errorpublic static org.apache.commons.httpclient.HttpMethod executeFollowRedirects(org.apache.commons.httpclient.HttpClient httpClient, org.apache.commons.httpclient.HttpMethod method) throws IOException
httpClient
- Http client instancemethod
- Http methodIOException
- on errorpublic static int executeNoRedirect(org.apache.commons.httpclient.HttpClient httpClient, org.apache.commons.httpclient.HttpMethod method) throws IOException
httpClient
- Http client instancemethod
- Http methodIOException
- on errorpublic static org.apache.jackrabbit.webdav.MultiStatusResponse[] executeSearchMethod(org.apache.commons.httpclient.HttpClient httpClient, String path, String searchRequest, int maxCount) throws IOException
httpClient
- http client instancepath
- encoded searched folder pathsearchRequest
- (SQL like) search requestmaxCount
- max item countIOException
- on errorpublic static org.apache.jackrabbit.webdav.MultiStatusResponse[] executePropFindMethod(org.apache.commons.httpclient.HttpClient httpClient, String path, int depth, org.apache.jackrabbit.webdav.property.DavPropertyNameSet properties) throws IOException
httpClient
- http client instancepath
- encoded searched folder pathdepth
- propfind request depthproperties
- propfind requested propertiesIOException
- on errorpublic static int executeDeleteMethod(org.apache.commons.httpclient.HttpClient httpClient, String path) throws IOException
httpClient
- Http client instancepath
- Path to be deletedIOException
- on errorpublic static org.apache.jackrabbit.webdav.MultiStatusResponse[] executeMethod(org.apache.commons.httpclient.HttpClient httpClient, org.apache.jackrabbit.webdav.client.methods.DavMethodBase method) throws IOException
httpClient
- http client instancemethod
- webdav methodIOException
- on errorprotected static int executeMethodFollowRedirectOnce(org.apache.commons.httpclient.HttpClient httpClient, org.apache.commons.httpclient.HttpMethod method) throws IOException
httpClient
- http clientmethod
- http methodIOException
- on errorpublic static org.apache.jackrabbit.webdav.MultiStatusResponse[] executeMethod(org.apache.commons.httpclient.HttpClient httpClient, ExchangeDavMethod method) throws IOException
httpClient
- http client instancemethod
- webdav methodIOException
- on errorpublic static int executeHttpMethod(org.apache.commons.httpclient.HttpClient httpClient, org.apache.commons.httpclient.HttpMethod method) throws IOException
httpClient
- Http client instancemethod
- Http methodIOException
- on errorpublic static boolean hasNTLMorNegotiate(org.apache.commons.httpclient.HttpClient httpClient)
httpClient
- HttpClient instancepublic static void addNTLM(org.apache.commons.httpclient.HttpClient httpClient)
httpClient
- HttpClient instancepublic static boolean acceptsNTLMOnly(org.apache.commons.httpclient.HttpMethod getMethod)
getMethod
- http methodpublic static int executeTestMethod(org.apache.commons.httpclient.HttpClient httpClient, org.apache.commons.httpclient.methods.GetMethod method) throws IOException
httpClient
- Http client instancemethod
- Http methodIOException
- on errorpublic static void executeGetMethod(org.apache.commons.httpclient.HttpClient httpClient, org.apache.commons.httpclient.methods.GetMethod method, boolean followRedirects) throws IOException
httpClient
- Http client instancemethod
- Http methodfollowRedirects
- Follow redirects flagIOException
- on errorpublic static org.apache.http.client.HttpResponseException buildHttpResponseException(org.apache.commons.httpclient.HttpMethod method)
method
- Http Methodpublic static boolean isGzipEncoded(org.apache.commons.httpclient.HttpMethod method)
method
- http methodpublic static void stop()
public static void createMultiThreadedHttpConnectionManager(org.apache.commons.httpclient.HttpClient httpClient)
httpClient
- httpClient instancepublic static void start()
public static String getUserAgent()
Copyright © 2001–2020 MickaĆ«l Guessant. All rights reserved.