Summary
- Assembly
- NAnt
.Core .dll - Namespace
- NAnt
.Core .Tasks - Interfaces
- Base Types
Syntax
[TaskName("get")]
public class GetTask : Task, IConditional
Examples
Gets the index page of the NAnt home page, and stores it in the file
help/index.html
relative to the project base directory.
<get src="http://nant.sourceforge.org/" dest="help/index.html" />
Gets the index page of a secured web site using the given credentials, while connecting using the specified password-protected proxy server.
<get src="http://password.protected.site/index.html" dest="secure/index.html">
<credentials username="user" password="guess" domain="mydomain" />
<proxy host="proxy.company.com" port="8080">
<credentials username="proxyuser" password="dunno" />
</proxy>
</get>
Remarks
Options include verbose reporting and timestamp based fetches.
Currently, only HTTP and UNC protocols are supported. FTP support may be added when more pluggable protocols are added to the System.Net assembly.
The NAnt.Core.Tasks.GetTask.UseTimeStamp
option enables you to control downloads
so that the remote file is only fetched if newer than the local copy.
If there is no local copy, the download always takes place. When a file
is downloaded, the timestamp of the downloaded file is set to the remote
timestamp.
Attributes
Type | Description |
---|---|
TaskNameAttribute | Indicates that class should be treated as a task. |
Properties
Name | Value | Summary |
---|---|---|
Certificates | FileSet |
The security certificates to associate with the request.
|
Credentials | Credential |
The network credentials used for authenticating the request with
the Internet resource.
|
CustomXmlProcessing | bool |
Gets a value indicating whether the element is performing additional
processing using the
NAnt.Core.Element.XmlNode that was used to
initialize the element.
Inherited from Element
|
DestinationFile | FileInfo |
The file where to store the retrieved file.
|
FailOnError | bool |
Determines if task failure stops the build, or is just reported.
The default is
true .
Inherited from Task
|
HttpProxy | string |
If inside a firewall, proxy server/port information
Format: {proxy server name}:{port number}
Example: proxy.mycompany.com:8080
|
IfDefined | bool |
If
true then the task will be executed; otherwise,
skipped. The default is true .
Inherited from Task
|
IgnoreErrors | bool |
Log errors but don't treat as fatal. The default is
false .
|
Location | Location |
Gets or sets the location in the build file where the element is
defined.
Inherited from Element
|
LogPrefix | string |
The prefix used when sending messages to the log.
Inherited from Task
|
Name | string |
The name of the task.
Inherited from Task
|
NamespaceManager | XmlNamespaceManager |
Gets or sets the
System.Xml.XmlNamespaceManager .
Inherited from Element
|
Parent | Object |
Gets or sets the parent of the element.
Inherited from Element
|
Project | Project |
Gets or sets the
NAnt.Core.Element.Project to which this element belongs.
Inherited from Element
|
Properties | PropertyDictionary |
Gets the properties local to this
NAnt.Core.Element and the
NAnt.Core.Element.Project .
Inherited from Element
|
Proxy | Proxy |
The network proxy to use to access the Internet resource.
|
Source | string |
The URL from which to retrieve a file.
|
Threshold | Level |
Gets or sets the log threshold for this
NAnt.Core.Task . By
default the threshold of a task is NAnt.Core.Level.Debug ,
causing no messages to be filtered in the task itself.
Inherited from Task
|
Timeout | int |
The length of time, in milliseconds, until the request times out.
The default is
100000 milliseconds.
|
UnlessDefined | bool |
Opposite of
NAnt.Core.Task.IfDefined . If false
then the task will be executed; otherwise, skipped. The default is
false .
Inherited from Task
|
UseTimeStamp | bool |
Conditionally download a file based on the timestamp of the local
copy. HTTP only. The default is
false .
|
Verbose | bool |
Determines whether the task should report detailed build log messages.
The default is
false .
Inherited from Task
|
XmlNode | XmlNode |
Gets or sets the XML node of the element.
Inherited from Element
|
Methods
Name | Value | Summary |
---|---|---|
CopyTo |
void |
Copies all instance data of the
NAnt.Core.Element to a given
NAnt.Core.Element .
Inherited from Element
|
Execute |
void |
Executes the task unless it is skipped.
Inherited from Task
|
ExecuteTask |
void |
This is where the work is done
|
Get |
XmlNode |
Locates the XML node for the specified attribute in either the
configuration section of the extension assembly or the.project.
Inherited from Task
|
Get |
XmlNode |
Inherited from Element
|
GetLocation |
Location |
Retrieves the location in the build file where the element is
defined.
Inherited from Element
|
Initialize |
void |
Initializes task and ensures the supplied attributes are valid.
|
Initialize |
void |
Performs default initialization.
Inherited from Element
|
Initialize |
Element |
Initializes the build element.
Inherited from Element
static
|
InitializeElement |
void |
Derived classes should override to this method to provide extra
initialization and validation not covered by the base class.
Inherited from Element
|
InitializeTask |
void |
Initializes the task.
Inherited from Task
|
Initialize |
void |
Initializes the configuration of the task using configuration
settings retrieved from the NAnt configuration file.
Inherited from Task
|
InitializeXml |
void |
Initializes all build attributes and child elements.
Inherited from Element
|
IsLogEnabledFor |
bool |
Determines whether build output is enabled for the given
NAnt.Core.Level .
Inherited from Task
|
Log |
void |
Logs a message with the given priority.
Inherited from Task
|
Log |
void |
Logs a formatted message with the given priority.
Inherited from Task
|
TouchFile |
void |
Sets the timestamp of a given file to a specified time.
|