public class Download extends org.gradle.api.DefaultTask implements DownloadSpec
task downloadFile(type: Download) {
src 'http://www.example.com/file.ext'
dest buildDir
}
| Constructor and Description |
|---|
Download() |
| Modifier and Type | Method and Description |
|---|---|
void |
dest(java.lang.Object dest)
Sets the download destination
|
void |
download()
Starts downloading
|
java.io.File |
getDest() |
java.lang.String |
getPassword() |
java.net.URL |
getSrc() |
java.lang.String |
getUsername() |
boolean |
isOnlyIfNewer() |
boolean |
isOverwrite() |
boolean |
isQuiet() |
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 |
addValidator, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, executeWithoutThrowingTaskFailure, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getStandardOutputCapture, getState, getStateInternal, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, leftShift, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setMustRunAfter, setName, setOnlyIf, setOnlyIf, setProject, setProperty, toStringpublic void download()
throws java.io.IOException
java.io.IOException - if the file could not downloadedpublic void src(java.lang.Object src)
throws java.net.MalformedURLException
DownloadSpecsrc in interface DownloadSpecsrc - the URLjava.net.MalformedURLException - if the download source is not a URLpublic void dest(java.lang.Object dest)
DownloadSpecdest in interface DownloadSpecdest - a file or directory where to store the retrieved filepublic void quiet(boolean quiet)
DownloadSpecquiet in interface DownloadSpecquiet - true if download progress should not be loggedpublic void overwrite(boolean overwrite)
DownloadSpecoverwrite in interface DownloadSpecoverwrite - true if existing files should be overwritten, false otherwisepublic void onlyIfNewer(boolean onlyIfNewer)
DownloadSpeconlyIfNewer in interface DownloadSpeconlyIfNewer - true if the file should only be downloaded if it
has been modified on the server since the last downloadpublic void username(java.lang.String username)
DownloadSpecBasic authenticationusername in interface DownloadSpecusername - the usernamepublic void password(java.lang.String password)
DownloadSpecBasic authenticationpassword in interface DownloadSpecpassword - the passwordpublic java.net.URL getSrc()
getSrc in interface DownloadSpecpublic java.io.File getDest()
getDest in interface DownloadSpecpublic boolean isQuiet()
isQuiet in interface DownloadSpecpublic boolean isOverwrite()
isOverwrite in interface DownloadSpecpublic boolean isOnlyIfNewer()
isOnlyIfNewer in interface DownloadSpecpublic java.lang.String getUsername()
getUsername in interface DownloadSpecBasic authenticationpublic java.lang.String getPassword()
getPassword in interface DownloadSpecBasic authentication