Apache Ant Tasks 简明教程
Apache Ant Tasks - Move
Description
Move 任务将文件移动到新文件或目录中,或将文件集合移动到新目录中。默认情况下,如果目标文件已存在,则会覆盖该文件。当 overwrite 关闭时,只有源文件比目标文件更新时或当目标文件不存在时,才会移动文件。
Move task moves a file to a new file or directory, or collections of files to a new directory. By default, the destination file is overwritten if it already exists. When overwrite is turned off, then files are only moved if the source file is newer than the destination file, or when the destination file does not exist.
Properties
Sr.No |
Attributes & Description |
1 |
File The file or directory to move. |
2 |
Preservelastmodified Give the moved files the same last modified time as the original source files. |
3 |
Tofile The file to move to. |
4 |
Todir The directory to move to. |
5 |
Overwrite Overwrite existing files even if the destination files are newer. |
6 |
Force Overwrite read-only destination files. |
7 |
Filtering Indicates whether token filtering should take place during the move. |
8 |
Flatten Ignore directory structure of source directory, copy all files into a single directory, specified by the todir attribute. |
9 |
IncludeEmptyDirs Copy empty directories included with the nested FileSet(s). |
10 |
Failonerror If false, log a warning message, but do not stop the build, when the file to copy does not exist or one of the nested filesets points to a directory that doesn’t exist or an error occurs while moving. |
11 |
Quiet If true and failonerror is false, then do not log a warning message when the file to copy does not exist or one of the nested filesets points to a directory that doesn’t exist or an error occurs while copying. |
12 |
Verbose Log the files that are being moved. |
13 |
Encoding The encoding to assume when filter-copying the files. |
14 |
Outputencoding The encoding to use when writing the files. |
15 |
Enablemultiplemappings If true the task will process to all the mappings for a given source path. If false the task will only process the first file or directory. This attribute is only relevant if there is a mapper subelement. |
16 |
Granularity The number of milliseconds leeway to give before deciding a file is out of date. This is needed because not every file system supports tracking the last modified time to the millisecond level. This can also be useful if source and target files live on separate machines with clocks being out of sync. |
17 |
performGCOnFailedDelete If Ant fails to delete a file or directory it will retry the operation once. If this flag is set to true it will perform a garbage collection before retrying the delete. Setting this flag to true is known to resolve some problems on Windows (where it defaults to true) but also for directory trees residing on an NFS share. |