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(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() |
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(java.lang.String relativeOrAbsoluteUrl,
long timeout) |
java.io.File |
download(org.openqa.selenium.WebElement element,
long timeout) |
protected org.apache.http.HttpResponse |
executeHttpRequest(java.lang.String fileToDownloadLocation,
long timeout) |
protected java.lang.String |
getFileName(java.lang.String fileToDownloadLocation,
org.apache.http.HttpResponse response) |
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,
long timeout)
throws java.io.IOException
java.io.IOExceptionpublic java.io.File download(java.lang.String relativeOrAbsoluteUrl,
long timeout)
throws java.io.IOException
java.io.IOExceptionprotected org.apache.http.HttpResponse executeHttpRequest(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()
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)
protected java.io.File saveFileContent(org.apache.http.HttpResponse response,
java.io.File downloadedFile)
throws java.io.IOException
java.io.IOException