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
Constructors -
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 a URL and return the source page.Default timeout used by the jcifs fix.voidsetCustomUserAgent(HttpRequest.Builder httpRequest) voidsetMethodInjection(AbstractMethodInjection methodInjection) voidsetTypeRequest(String typeRequest) voidsetUrlBase(String urlBase) voidsetUrlByUser(String urlByUser) voidwithMethodInjection(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. -
testConnection
-
getSourceLineFeed
Call a URL and return the source page.- Parameters:
url- to call- Returns:
- the source page of the URL
-
getSource
-
getSource
-
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
-