Moves a file or directory to a new file or 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.
Source files and directories are only deleted when the file or
directory has been copied to the destination successfully. Filtering
also works.
This implementation is based on Arnout Kuiper's initial design
document, the following mailing list discussions, and the
copyfile/copydir tasks.
deleteDir(java.io.File d)
Go and delete the directory tree.
protected void
doFileOperations()
Actually does the file (and possibly empty directory) copies.
protected boolean
okToDelete(java.io.File d)
Its only ok to delete a directory tree if there are
no files in it.
protected boolean
renameFile(java.io.File sourceFile,
java.io.File destFile,
boolean filtering,
boolean overwrite)
Attempts to rename a file from a source to a destination.
Methods inherited from class org.apache.tools.ant.taskdefs.Copy
Attempts to rename a file from a source to a destination.
If overwrite is set to true, this method overwrites existing file
even if the destination file is newer. Otherwise, the source file is
renamed only if the destination file is older than it.
Method then checks if token filtering is used. If it is, this method
returns false assuming it is the responsibility to the copyFile method.