|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
de.undercouch.gradle.tasks.download.Download
public class Download
Downloads a file and displays progress. Example:
task downloadFile(type: Download) {
src 'http://www.example.com/file.ext'
dest buildDir
}
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.gradle.api.Task |
|---|
org.gradle.api.Task.Namer |
| Field Summary |
|---|
| Fields inherited from interface org.gradle.api.Task |
|---|
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE |
| Constructor Summary | |
|---|---|
Download()
|
|
| Method Summary | |
|---|---|
void |
compress(boolean compress)
Specifies if compression should be used during download |
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 |
isCompress()
|
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 |
| Methods inherited from class org.gradle.api.internal.AbstractTask |
|---|
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, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Download()
| Method Detail |
|---|
public void download()
throws java.io.IOException
java.io.IOException - if the file could not downloaded
public void src(java.lang.Object src)
throws java.net.MalformedURLException
DownloadSpec
src in interface DownloadSpecsrc - the URL
java.net.MalformedURLException - if the download source is not a URLpublic void dest(java.lang.Object dest)
DownloadSpec
dest in interface DownloadSpecdest - a file or directory where to store the retrieved filepublic void quiet(boolean quiet)
DownloadSpec
quiet in interface DownloadSpecquiet - true if download progress should not be loggedpublic void overwrite(boolean overwrite)
DownloadSpec
overwrite in interface DownloadSpecoverwrite - true if existing files should be overwritten, false otherwisepublic void onlyIfNewer(boolean onlyIfNewer)
DownloadSpec
onlyIfNewer in interface DownloadSpeconlyIfNewer - true if the file should only be downloaded if it
has been modified on the server since the last downloadpublic void compress(boolean compress)
DownloadSpec
compress in interface DownloadSpeccompress - true if compression should be enabledpublic void username(java.lang.String username)
DownloadSpecBasic authentication
username in interface DownloadSpecusername - the usernamepublic void password(java.lang.String password)
DownloadSpecBasic authentication
password 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 boolean isCompress()
isCompress in interface DownloadSpecpublic java.lang.String getUsername()
getUsername in interface DownloadSpecBasic authenticationpublic java.lang.String getPassword()
getPassword in interface DownloadSpecBasic authentication
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||