Package com.codeborne.selenide.impl
Class DownloadFileWithHttpRequest
java.lang.Object
com.codeborne.selenide.impl.DownloadFileWithHttpRequest
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddHttpHeaders(Driver driver, org.apache.hc.client5.http.classic.methods.HttpGet httpGet) protected voidconfigureHttpGet(org.apache.hc.client5.http.classic.methods.HttpGet httpGet, long timeout) protected org.apache.hc.client5.http.impl.classic.CloseableHttpClientprotected org.apache.hc.core5.http.protocol.HttpContextcreateHttpContext(Driver driver) protected org.apache.hc.client5.http.impl.classic.CloseableHttpClientconfigure HttpClient to ignore self-signed certs as described here: http://literatejava.com/networks/ignore-ssl-certificate-errors-apache-httpclient-4-4/download(Driver driver, String relativeOrAbsoluteUrl, long timeout, FileFilter fileFilter) download(Driver driver, URI url, long timeout, FileFilter fileFilter) download(Driver driver, org.openqa.selenium.WebElement element, long timeout, FileFilter fileFilter) protected org.apache.hc.client5.http.impl.classic.CloseableHttpResponseexecuteHttpRequest(Driver driver, String fileToDownloadLocation, long timeout) protected StringgetFileName(String fileToDownloadLocation, org.apache.hc.core5.http.HttpResponse response) protected voidsaveContentToFile(org.apache.hc.client5.http.impl.classic.CloseableHttpResponse response, File downloadedFile)
-
Field Details
-
ignoreSelfSignedCerts
protected boolean ignoreSelfSignedCerts
-
-
Constructor Details
-
DownloadFileWithHttpRequest
public DownloadFileWithHttpRequest()
-
-
Method Details
-
download
@CheckReturnValue @Nonnull public File download(Driver driver, org.openqa.selenium.WebElement element, long timeout, FileFilter fileFilter) throws IOException - Throws:
IOException
-
download
@CheckReturnValue @Nonnull public File download(Driver driver, URI url, long timeout, FileFilter fileFilter) throws IOException - Throws:
IOException
-
download
@CheckReturnValue @Nonnull public File download(Driver driver, String relativeOrAbsoluteUrl, long timeout, FileFilter fileFilter) throws IOException - Throws:
IOException
-
executeHttpRequest
@CheckReturnValue @Nonnull protected org.apache.hc.client5.http.impl.classic.CloseableHttpResponse executeHttpRequest(Driver driver, String fileToDownloadLocation, long timeout) throws IOException - Throws:
IOException
-
configureHttpGet
protected void configureHttpGet(org.apache.hc.client5.http.classic.methods.HttpGet httpGet, long timeout) -
createDefaultHttpClient
@CheckReturnValue @Nonnull protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient createDefaultHttpClient() -
createTrustingHttpClient
@CheckReturnValue @Nonnull protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient createTrustingHttpClient() throws IOExceptionconfigure HttpClient to ignore self-signed certs as described here: http://literatejava.com/networks/ignore-ssl-certificate-errors-apache-httpclient-4-4/- Throws:
IOException
-
createHttpContext
@CheckReturnValue @Nonnull protected org.apache.hc.core5.http.protocol.HttpContext createHttpContext(Driver driver) -
addHttpHeaders
protected void addHttpHeaders(Driver driver, org.apache.hc.client5.http.classic.methods.HttpGet httpGet) -
getFileName
-
saveContentToFile
protected void saveContentToFile(org.apache.hc.client5.http.impl.classic.CloseableHttpResponse response, File downloadedFile) throws IOException - Throws:
IOException
-