Package com.codeborne.selenide.impl
Class DownloadFileWithHttpRequest
- java.lang.Object
-
- com.codeborne.selenide.impl.DownloadFileWithHttpRequest
-
public class DownloadFileWithHttpRequest extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanignoreSelfSignedCerts
-
Constructor Summary
Constructors Constructor Description DownloadFileWithHttpRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddHttpHeaders(Driver driver, org.apache.http.client.methods.HttpGet httpGet)protected voidconfigureHttpGet(org.apache.http.client.methods.HttpGet httpGet, long timeout)protected org.apache.http.impl.client.CloseableHttpClientcreateDefaultHttpClient()protected org.apache.http.protocol.HttpContextcreateHttpContext(Driver driver)protected org.apache.http.impl.client.CloseableHttpClientcreateTrustingHttpClient()configure HttpClient to ignore self-signed certs as described here: http://literatejava.com/networks/ignore-ssl-certificate-errors-apache-httpclient-4-4/java.io.Filedownload(Driver driver, java.lang.String relativeOrAbsoluteUrl, long timeout, FileFilter fileFilter)java.io.Filedownload(Driver driver, org.openqa.selenium.WebElement element, long timeout, FileFilter fileFilter)protected org.apache.http.HttpResponseexecuteHttpRequest(Driver driver, java.lang.String fileToDownloadLocation, long timeout)protected java.lang.StringgetFileName(java.lang.String fileToDownloadLocation, org.apache.http.HttpResponse response)protected voidsaveContentToFile(org.apache.http.HttpResponse response, java.io.File downloadedFile)
-
-
-
Method Detail
-
download
public java.io.File download(Driver driver, org.openqa.selenium.WebElement element, long timeout, FileFilter fileFilter) throws java.io.IOException
- Throws:
java.io.IOException
-
download
public java.io.File download(Driver driver, java.lang.String relativeOrAbsoluteUrl, long timeout, FileFilter fileFilter) throws java.io.IOException
- Throws:
java.io.IOException
-
executeHttpRequest
protected org.apache.http.HttpResponse executeHttpRequest(Driver driver, java.lang.String fileToDownloadLocation, long timeout) throws java.io.IOException
- Throws:
java.io.IOException
-
configureHttpGet
protected void configureHttpGet(org.apache.http.client.methods.HttpGet httpGet, long timeout)
-
createDefaultHttpClient
protected org.apache.http.impl.client.CloseableHttpClient createDefaultHttpClient()
-
createTrustingHttpClient
protected org.apache.http.impl.client.CloseableHttpClient createTrustingHttpClient() throws java.io.IOExceptionconfigure HttpClient to ignore self-signed certs as described here: http://literatejava.com/networks/ignore-ssl-certificate-errors-apache-httpclient-4-4/- Throws:
java.io.IOException
-
createHttpContext
protected org.apache.http.protocol.HttpContext createHttpContext(Driver driver)
-
addHttpHeaders
protected void addHttpHeaders(Driver driver, org.apache.http.client.methods.HttpGet httpGet)
-
getFileName
protected java.lang.String getFileName(java.lang.String fileToDownloadLocation, org.apache.http.HttpResponse response)
-
saveContentToFile
protected void saveContentToFile(org.apache.http.HttpResponse response, java.io.File downloadedFile) throws java.io.IOException- Throws:
java.io.IOException
-
-