|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--org.apache.tools.ant.taskdefs.Get
Gets a particular file from a URL source. Options include verbose reporting, timestamp based fetches and controlling actions on failures. NB: access through a firewall only works if the whole Java runtime is correctly configured.
Field Summary |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
Get()
|
Method Summary | |
void |
execute()
Does the work. |
void |
setDest(java.io.File dest)
Where to copy the source file. |
void |
setIgnoreErrors(boolean v)
If true, log errors but do not treat as fatal. |
void |
setPassword(java.lang.String p)
password for the basic authentication. |
void |
setSrc(java.net.URL u)
Set the URL to get. |
void |
setUsername(java.lang.String u)
Username for basic auth. |
void |
setUseTimestamp(boolean v)
If true, conditionally download a file based on the timestamp of the local copy. |
void |
setVerbose(boolean v)
If true, show verbose progress information. |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Get()
Method Detail |
public void execute() throws BuildException
execute
in class Task
BuildException
- Thrown in unrecoverable error.public void setSrc(java.net.URL u)
u
- URL for the file.public void setDest(java.io.File dest)
dest
- Path to file.public void setVerbose(boolean v)
v
- if "true" then be verbosepublic void setIgnoreErrors(boolean v)
v
- if "true" then don't report download errors up to antpublic void setUseTimestamp(boolean v)
In this situation, the if-modified-since header is set so that the file is only fetched if it is newer than the local file (or there is no local file) This flag is only valid on HTTP connections, it is ignored in other cases. When the flag is set, the local copy of the downloaded file will also have its timestamp set to the remote file time.
Note that remote files of date 1/1/1970 (GMT) are treated as 'no timestamp', and web servers often serve files with a timestamp in the future by replacing their timestamp with that of the current time. Also, inter-computer clock differences can cause no end of grief.
v
- "true" to enable file time fetchingpublic void setUsername(java.lang.String u)
u
- username for authenticationpublic void setPassword(java.lang.String p)
p
- password for authentication
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |