public class DownloadFileWithHttpRequest
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
ignoreSelfSignedCerts |
| Constructor and Description |
|---|
DownloadFileWithHttpRequest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addHttpHeaders(org.apache.http.client.methods.HttpGet httpGet) |
protected void |
configureHttpGet(org.apache.http.client.methods.HttpGet httpGet) |
protected org.apache.http.impl.client.CloseableHttpClient |
createDefaultHttpClient() |
protected org.apache.http.protocol.HttpContext |
createHttpContext() |
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(org.openqa.selenium.WebElement element) |
protected org.apache.http.impl.cookie.BasicClientCookie |
duplicateCookie(org.openqa.selenium.Cookie seleniumCookie) |
protected org.apache.http.HttpResponse |
executeHttpRequest(java.lang.String fileToDownloadLocation) |
protected java.lang.String |
getFileName(java.lang.String fileToDownloadLocation,
org.apache.http.HttpResponse response) |
protected org.apache.http.impl.client.BasicCookieStore |
mimicCookieState() |
protected java.io.File |
prepareTargetFile(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(org.openqa.selenium.WebElement element)
throws java.io.IOException
java.io.IOExceptionprotected org.apache.http.HttpResponse executeHttpRequest(java.lang.String fileToDownloadLocation)
throws java.io.IOException
java.io.IOExceptionprotected void configureHttpGet(org.apache.http.client.methods.HttpGet httpGet)
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()
protected void addHttpHeaders(org.apache.http.client.methods.HttpGet httpGet)
protected java.io.File prepareTargetFile(java.lang.String fileToDownloadLocation,
org.apache.http.HttpResponse response)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionprotected java.lang.String getFileName(java.lang.String fileToDownloadLocation,
org.apache.http.HttpResponse response)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionprotected org.apache.http.impl.client.BasicCookieStore mimicCookieState()
protected org.apache.http.impl.cookie.BasicClientCookie duplicateCookie(org.openqa.selenium.Cookie seleniumCookie)
protected java.io.File saveFileContent(org.apache.http.HttpResponse response,
java.io.File downloadedFile)
throws java.io.IOException
java.io.IOException