use of com.codeborne.selenide.ex.TimeoutException in project selenide by selenide.
the class DownloadFileWithHttpRequest method executeHttpRequest.
@CheckReturnValue
@Nonnull
protected CloseableHttpResponse executeHttpRequest(Driver driver, String fileToDownloadLocation, long timeout) throws IOException {
CloseableHttpClient httpClient = ignoreSelfSignedCerts ? createTrustingHttpClient() : createDefaultHttpClient();
HttpGet httpGet = new HttpGet(fileToDownloadLocation);
configureHttpGet(httpGet, timeout);
addHttpHeaders(driver, httpGet);
try {
return httpClient.execute(httpGet, createHttpContext(driver));
} catch (SocketTimeoutException timeoutException) {
throw new TimeoutException("Failed to download " + fileToDownloadLocation + " in " + timeout + " ms.", timeoutException);
}
}
Aggregations