Apache Ant Copy Task
This task is used to copy file or resource to a new location. It copies only if the source files is newer than the destination file. We can also explicitly overwrite it by using overwrite attribute.
The todir attribute is used to set the destination path. This task uses various attributes which are given below.
Apache Ant Copy Task Attributes
Apache Ant Copy Task Example
Lets see an example in which we are copying data from one file to another. See the example below.
Copy single file
Copy file to directory
Copy directory to another directory