Save This Page
Home » apache-ant-1.7.1-src » org.apache.tools » ant » taskdefs » [javadoc | source]
org.apache.tools.ant.taskdefs
public class: Get [javadoc | source]
java.lang.Object
   org.apache.tools.ant.ProjectComponent
      org.apache.tools.ant.Task
         org.apache.tools.ant.taskdefs.Get

All Implemented Interfaces:
    Cloneable

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.
Nested Class Summary:
protected static class  Get.Base64Converter  Provide this for Backward Compatibility. 
public interface  Get.DownloadProgress  Interface implemented for reporting progess of downloading. 
public static class  Get.NullProgress  do nothing with progress info 
public static class  Get.VerboseProgress  verbose progress system prints to some output stream 
Fields inherited from org.apache.tools.ant.Task:
target,  taskName,  taskType,  wrapper
Fields inherited from org.apache.tools.ant.ProjectComponent:
project,  location,  description
Method from org.apache.tools.ant.taskdefs.Get Summary:
doGet,   execute,   setDest,   setIgnoreErrors,   setPassword,   setSrc,   setUseTimestamp,   setUsername,   setVerbose
Methods from org.apache.tools.ant.Task:
bindToOwner,   execute,   getOwningTarget,   getRuntimeConfigurableWrapper,   getTaskName,   getTaskType,   getWrapper,   handleErrorFlush,   handleErrorOutput,   handleFlush,   handleInput,   handleOutput,   init,   isInvalid,   log,   log,   log,   log,   markInvalid,   maybeConfigure,   perform,   reconfigure,   setOwningTarget,   setRuntimeConfigurableWrapper,   setTaskName,   setTaskType
Methods from org.apache.tools.ant.ProjectComponent:
clone,   getDescription,   getLocation,   getProject,   log,   log,   setDescription,   setLocation,   setProject
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.taskdefs.Get Detail:
 public boolean doGet(int logLevel,
    Get.DownloadProgress progress) throws IOException 
    make a get request, with the supplied progress and logging info. All the other config parameters are set at the task level, source, dest, ignoreErrors, etc.
 public  void execute() throws BuildException 
    Does the work.
 public  void setDest(File dest) 
    Where to copy the source file.
 public  void setIgnoreErrors(boolean v) 
    If true, log errors but do not treat as fatal.
 public  void setPassword(String p) 
    password for the basic authentication.
 public  void setSrc(URL u) 
    Set the URL to get.
 public  void setUseTimestamp(boolean v) 
    If true, conditionally download a file based on the timestamp of the local copy.

    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.

 public  void setUsername(String u) 
    Username for basic auth.
 public  void setVerbose(boolean v) 
    If true, show verbose progress information.