org.apache.tools.ant.taskdefs

Class Sync

public class Sync extends Task

Synchronize a local target directory from the files defined in one or more filesets.

Uses a <copy> task internally, but forbidding the use of mappers and filter chains. Files of the destination directory not present in any of the source fileset are removed.

Since: Ant 1.6 revised by Dan Armbrust to remove orphaned directories.

UNKNOWN: category="filesystem"

Nested Class Summary
static classSync.MyCopy
Subclass Copy in order to access it's file/dir maps.
Method Summary
voidaddFileset(FileSet set)
Adds a set of files to copy.
voidexecute()
voidinit()
voidsetFailOnError(boolean failonerror)
If false, note errors to the output but keep going.
voidsetGranularity(long granularity)
The number of milliseconds leeway to give before deciding a target is out of date.
voidsetIncludeEmptyDirs(boolean includeEmpty)
Used to copy empty directories.
voidsetOverwrite(boolean overwrite)
Overwrite any existing destination file(s).
voidsetTodir(File destDir)
Sets the destination directory.
voidsetVerbose(boolean verbose)
Used to force listing of all names of copied files.

Method Detail

addFileset

public void addFileset(FileSet set)
Adds a set of files to copy.

execute

public void execute()

init

public void init()

setFailOnError

public void setFailOnError(boolean failonerror)
If false, note errors to the output but keep going.

Parameters: failonerror true or false

setGranularity

public void setGranularity(long granularity)
The number of milliseconds leeway to give before deciding a target is out of date.

Default is 0 milliseconds, or 2 seconds on DOS systems.

Since: Ant 1.6.2

setIncludeEmptyDirs

public void setIncludeEmptyDirs(boolean includeEmpty)
Used to copy empty directories.

setOverwrite

public void setOverwrite(boolean overwrite)
Overwrite any existing destination file(s).

setTodir

public void setTodir(File destDir)
Sets the destination directory.

setVerbose

public void setVerbose(boolean verbose)
Used to force listing of all names of copied files.
Copyright