Package com.jsql.util
Class ConnectionUtil
java.lang.Object
com.jsql.util.ConnectionUtil
Utility class in charge of connection to web resources and management
of source page and request and response headers.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCheck that the connection to the website is working correctly.getHeadersMap
(HttpHeaders httpHeaders) getHeadersMap
(HttpResponse<T> httpResponse) getSourceLineFeed
(String url) Call an URL and return the source page.Default timeout used by the jcifs fix.void
setCustomUserAgent
(HttpRequest.Builder httpRequest) void
setMethodInjection
(AbstractMethodInjection methodInjection) void
setTypeRequest
(String typeRequest) void
setUrlBase
(String urlBase) void
setUrlByUser
(String urlByUser) void
withMethodInjection
(AbstractMethodInjection methodInjection) withTypeRequest
(String typeRequest)
-
Constructor Details
-
ConnectionUtil
-
-
Method Details
-
getHttpClient
-
getHeadersMap
-
getHeadersMap
-
checkConnectionResponse
public HttpResponse<String> checkConnectionResponse() throws IOException, InterruptedException, JSqlExceptionCheck that the connection to the website is working correctly. It uses authentication defined by user, with fixed timeout, and warn user in case of authentication detected.- Returns:
- Throws:
IOException
InterruptedException
JSqlException
-
testConnection
-
getSource
-
getSourceLineFeed
Call an URL and return the source page.- Parameters:
url
- to call- Returns:
- the source page of the URL
-
getSource
-
setCustomUserAgent
-
withMethodInjection
-
withTypeRequest
-
getUrlByUser
-
setUrlByUser
-
getUrlBase
-
setUrlBase
-
getMethodInjection
-
setMethodInjection
-
getTypeRequest
-
setTypeRequest
-
getTimeout
Default timeout used by the jcifs fix. It's the default value used usually by the JVM. -
getCookieManager
-