@ParametersAreNonnullByDefault
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.hc.client5.http.classic.methods.HttpGet httpGet) |
protected void |
configureHttpGet(org.apache.hc.client5.http.classic.methods.HttpGet httpGet,
long timeout) |
protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient |
createDefaultHttpClient() |
protected org.apache.hc.core5.http.protocol.HttpContext |
createHttpContext(Driver driver) |
protected org.apache.hc.client5.http.impl.classic.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,
FileFilter fileFilter) |
java.io.File |
download(Driver driver,
java.net.URI url,
long timeout,
FileFilter fileFilter) |
java.io.File |
download(Driver driver,
org.openqa.selenium.WebElement element,
long timeout,
FileFilter fileFilter) |
protected org.apache.hc.client5.http.impl.classic.CloseableHttpResponse |
executeHttpRequest(Driver driver,
java.lang.String fileToDownloadLocation,
long timeout) |
protected java.lang.String |
getFileName(java.lang.String fileToDownloadLocation,
org.apache.hc.core5.http.HttpResponse response) |
protected void |
saveContentToFile(org.apache.hc.client5.http.impl.classic.CloseableHttpResponse response,
java.io.File downloadedFile) |
@CheckReturnValue @Nonnull public java.io.File download(Driver driver, org.openqa.selenium.WebElement element, long timeout, FileFilter fileFilter) throws java.io.IOException
java.io.IOException@CheckReturnValue @Nonnull public java.io.File download(Driver driver, java.net.URI url, long timeout, FileFilter fileFilter) throws java.io.IOException
java.io.IOException@CheckReturnValue @Nonnull public java.io.File download(Driver driver, java.lang.String relativeOrAbsoluteUrl, long timeout, FileFilter fileFilter) throws java.io.IOException
java.io.IOException@CheckReturnValue @Nonnull protected org.apache.hc.client5.http.impl.classic.CloseableHttpResponse executeHttpRequest(Driver driver, java.lang.String fileToDownloadLocation, long timeout) throws java.io.IOException
java.io.IOExceptionprotected void configureHttpGet(org.apache.hc.client5.http.classic.methods.HttpGet httpGet,
long timeout)
@CheckReturnValue @Nonnull protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient createDefaultHttpClient()
@CheckReturnValue
@Nonnull
protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient createTrustingHttpClient()
throws java.io.IOException
java.io.IOException@CheckReturnValue @Nonnull protected org.apache.hc.core5.http.protocol.HttpContext createHttpContext(Driver driver)
protected void addHttpHeaders(Driver driver, org.apache.hc.client5.http.classic.methods.HttpGet httpGet)
@CheckReturnValue
@Nonnull
protected java.lang.String getFileName(java.lang.String fileToDownloadLocation,
org.apache.hc.core5.http.HttpResponse response)
protected void saveContentToFile(org.apache.hc.client5.http.impl.classic.CloseableHttpResponse response,
java.io.File downloadedFile)
throws java.io.IOException
java.io.IOException