public class FileDownloader
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static FileDownloader |
instance |
| Constructor and Description |
|---|
FileDownloader() |
| Modifier and Type | Method and Description |
|---|---|
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 java.lang.String |
getFileNameFromContentDisposition(java.lang.String headerName,
java.lang.String headerValue) |
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 static FileDownloader instance
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 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 java.lang.String getFileNameFromContentDisposition(java.lang.String headerName,
java.lang.String headerValue)
protected 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