public class DownloadFileWithHttpRequest
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
ignoreSelfSignedCerts |
| Constructor and Description |
|---|
DownloadFileWithHttpRequest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addHttpHeaders(Driver driver,
org.apache.http.client.methods.HttpGet httpGet) |
protected void |
configureHttpGet(org.apache.http.client.methods.HttpGet httpGet,
long timeout) |
protected org.apache.http.impl.client.CloseableHttpClient |
createDefaultHttpClient() |
protected org.apache.http.protocol.HttpContext |
createHttpContext(Driver driver) |
protected org.apache.http.impl.client.CloseableHttpClient |
createTrustingHttpClient()
configure HttpClient to ignore self-signed certs
as described here: http://literatejava.com/networks/ignore-ssl-certificate-errors-apache-httpclient-4-4/
|
java.io.File |
download(Driver driver,
java.lang.String relativeOrAbsoluteUrl,
long timeout) |
java.io.File |
download(Driver driver,
org.openqa.selenium.WebElement element,
long timeout) |
protected org.apache.http.HttpResponse |
executeHttpRequest(Driver driver,
java.lang.String fileToDownloadLocation,
long timeout) |
protected java.lang.String |
getFileName(java.lang.String fileToDownloadLocation,
org.apache.http.HttpResponse response) |
protected java.io.File |
saveFileContent(org.apache.http.HttpResponse response,
java.io.File downloadedFile) |
public java.io.File download(Driver driver, org.openqa.selenium.WebElement element, long timeout) throws java.io.IOException
java.io.IOExceptionpublic java.io.File download(Driver driver, java.lang.String relativeOrAbsoluteUrl, long timeout) throws java.io.IOException
java.io.IOExceptionprotected org.apache.http.HttpResponse executeHttpRequest(Driver driver, java.lang.String fileToDownloadLocation, long timeout) throws java.io.IOException
java.io.IOExceptionprotected void configureHttpGet(org.apache.http.client.methods.HttpGet httpGet,
long timeout)
protected org.apache.http.impl.client.CloseableHttpClient createDefaultHttpClient()
protected org.apache.http.impl.client.CloseableHttpClient createTrustingHttpClient()
throws java.io.IOException
java.io.IOExceptionprotected org.apache.http.protocol.HttpContext createHttpContext(Driver driver)
protected void addHttpHeaders(Driver driver, org.apache.http.client.methods.HttpGet httpGet)
protected java.lang.String getFileName(java.lang.String fileToDownloadLocation,
org.apache.http.HttpResponse response)
protected java.io.File saveFileContent(org.apache.http.HttpResponse response,
java.io.File downloadedFile)
throws java.io.IOException
java.io.IOException