com.agiletools.ant.tasks
Class UrlGetTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bycom.agiletools.ant.tasks.UrlGetTask

public class UrlGetTask
extends org.apache.tools.ant.Task

this Ant task is intended to give a simple mean to download files in your ant scripts

Author:
G.Bertrand

Constructor Summary
UrlGetTask()
          default constructor.
 
Method Summary
 void execute()
          the execute method
 void setDir(java.io.File dir)
          the directory into which to place the downloaded resource.
 void setFailonerror(boolean fail)
          do we want the task to fail (and make the whole build script to fail) on error ?.
 void setFilename(java.lang.String filename)
          to which file do we want the downloaded file to be saved ?.
 void setUrl(java.net.URL url)
          the URL resource to download.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlGetTask

public UrlGetTask()
default constructor. will build a TaskLogger for logging purposes

Method Detail

setFailonerror

public void setFailonerror(boolean fail)
do we want the task to fail (and make the whole build script to fail) on error ?.
OPTIONAL

Parameters:
fail - set to true if you want the task to fail on error

setFilename

public void setFilename(java.lang.String filename)
to which file do we want the downloaded file to be saved ?. if not specified, the task will have 3 different fallbacks : name of the file in the url, name of host (if no url file specified) and then current timestamp.
if the file name contains slashes or backslashes (depending on system), the task will try to create subdirectories.
OPTIONAL

Parameters:
filename - the file into which to save the URL resource

setDir

public void setDir(java.io.File dir)
the directory into which to place the downloaded resource.
the parameter MUST be a directory MANDATORY

Parameters:
dir - the directory

setUrl

public void setUrl(java.net.URL url)
the URL resource to download.
MANDATORY

Parameters:
url -

execute

public void execute()
             throws org.apache.tools.ant.BuildException
the execute method

Throws:
org.apache.tools.ant.BuildException
See Also:
Task.execute()