public interface DownloadSpec
| Modifier and Type | Method and Description |
|---|---|
void |
acceptAnyCertificate(boolean accept)
Specifies if HTTPS certificate verification errors should be ignored
and any certificate (even an invalid one) should be accepted.
|
void |
cache(long amount,
java.util.concurrent.TimeUnit unit)
Sets minimal time of caching
|
void |
compress(boolean compress)
Specifies if compression should be used during download
|
void |
dest(java.lang.Object dest)
Sets the download destination
|
long |
getCache() |
java.io.File |
getDest() |
java.lang.String |
getHeader(java.lang.String name) |
java.util.Map<java.lang.String,java.lang.String> |
getHeaders() |
int |
getMaxDownloadThreads() |
java.lang.String |
getPassword() |
java.lang.Object |
getSrc() |
java.lang.String |
getUsername() |
void |
header(java.lang.String name,
java.lang.String value)
Sets an HTTP request header to use when downloading
|
void |
headers(java.util.Map<java.lang.String,java.lang.String> headers)
Sets the HTTP request headers to us when downloading
|
boolean |
isAcceptAnyCertificate() |
boolean |
isCompress() |
boolean |
isOnlyIfNewer() |
boolean |
isOverwrite() |
boolean |
isQuiet() |
void |
maxDownloadThreads(int maxDownloadThreads)
Sets maximal amount of parallel downloads
|
void |
onlyIfNewer(boolean onlyIfNewer)
Sets the onlyIfNewer flag
|
void |
overwrite(boolean overwrite)
Sets the overwrite flag
|
void |
password(java.lang.String password)
Sets the password for
Basic authentication |
void |
quiet(boolean quiet)
Sets the quiet flag
|
void |
src(java.lang.Object src)
Sets the download source URL
|
void |
username(java.lang.String username)
Sets the username for
Basic authentication |
void src(java.lang.Object src) throws java.net.MalformedURLException
src - the URLjava.net.MalformedURLException - if the download source is not a URLvoid dest(java.lang.Object dest)
dest - a file or directory where to store the retrieved filevoid quiet(boolean quiet)
quiet - true if download progress should not be loggedvoid overwrite(boolean overwrite)
overwrite - true if existing files should be overwritten, false otherwisevoid onlyIfNewer(boolean onlyIfNewer)
onlyIfNewer - true if the file should only be downloaded if it
has been modified on the server since the last downloadvoid compress(boolean compress)
compress - true if compression should be enabledvoid username(java.lang.String username)
Basic authenticationusername - the usernamevoid password(java.lang.String password)
Basic authenticationpassword - the passwordvoid headers(java.util.Map<java.lang.String,java.lang.String> headers)
headers - a Map of header names to valuesvoid header(java.lang.String name,
java.lang.String value)
name - name of the HTTP headervalue - value of the HTTP headervoid acceptAnyCertificate(boolean accept)
accept - true if certificate errors should be ignored (default: false)void cache(long amount,
java.util.concurrent.TimeUnit unit)
amount - cache time amountunit - cache time unitvoid maxDownloadThreads(int maxDownloadThreads)
maxDownloadThreads - amount of parallel downloadsjava.lang.Object getSrc()
java.io.File getDest()
boolean isQuiet()
boolean isOverwrite()
boolean isOnlyIfNewer()
boolean isCompress()
java.lang.String getUsername()
Basic authenticationjava.lang.String getPassword()
Basic authenticationjava.util.Map<java.lang.String,java.lang.String> getHeaders()
java.lang.String getHeader(java.lang.String name)
name - name of the HTTP headerboolean isAcceptAnyCertificate()
long getCache()
int getMaxDownloadThreads()