org.apache.tools.ant.taskdefs
Class Sync
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.
- Ant 1.6
revised by Dan Armbrust
to remove orphaned directories.
static class | Sync.MyCopy - Subclass Copy in order to access it's file/dir maps.
|
void | addFileset(FileSet set) - Adds a set of files to copy.
|
void | execute() - Called by the project to let the task do its work.
|
void | init() - Called by the project to let the task initialize properly.
|
void | setFailOnError(boolean failonerror) - If false, note errors to the output but keep going.
|
void | setGranularity(long granularity) - The number of milliseconds leeway to give before deciding a
target is out of date.
|
void | setIncludeEmptyDirs(boolean includeEmpty) - Used to copy empty directories.
|
void | setOverwrite(boolean overwrite) - Overwrite any existing destination file(s).
|
void | setTodir(File destDir) - Sets the destination directory.
|
void | setVerbose(boolean verbose) - Used to force listing of all names of copied files.
|
execute , getDescription , getLocation , getOwningTarget , getRuntimeConfigurableWrapper , getTaskName , getTaskType , getWrapper , handleErrorFlush , handleErrorOutput , handleFlush , handleInput , handleOutput , init , isInvalid , log , log , maybeConfigure , perform , reconfigure , setDescription , setLocation , setOwningTarget , setRuntimeConfigurableWrapper , setTaskName , setTaskType |
addFileset
public void addFileset(FileSet set)
Adds a set of files to copy.
execute
public void execute()
throws BuildException
Called by the project to let the task do its work. This method may be
called more than once, if the task is invoked more than once.
For example,
if target1 and target2 both depend on target3, then running
"ant target1 target2" will run all tasks in target3 twice.
- execute in interface Task
init
public void init()
throws BuildException
Called by the project to let the task initialize properly.
The default implementation is a no-op.
- init in interface Task
setFailOnError
public void setFailOnError(boolean failonerror)
If false, note errors to the output but keep going.
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.
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 © 2000-2006 Apache Software Foundation. All Rights Reserved.