Class Sync.MyCopy
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Copy
org.apache.tools.ant.taskdefs.Sync.MyCopy
- All Implemented Interfaces:
Cloneable
- Enclosing class:
Sync
Subclass Copy in order to access it's file/dir maps.
- Since:
- Ant 1.6 revised by Dan Armbrust to remove orphaned directories.
-
Field Summary
Fields inherited from class Copy
completeDirMap, destDir, destFile, dirCopyMap, failonerror, file, fileCopyMap, filesets, fileUtils, filtering, flatten, forceOverwrite, includeEmpty, mapperElement, preserveLastModified, rcs, verbosityModifier and TypeFieldDescriptionprotected Fileprotected Fileprotected booleanprotected Fileprotected Vector<ResourceCollection> protected FileUtilsprotected booleanprotected booleanprotected booleanprotected booleanprotected Mapperprotected booleanprotected Vector<ResourceCollection> protected intFields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the includeEmptyDirs attribute.getToDir()Get the destination directory.protected voidCompares source files to destination files to see if they should be copied.Compares source resources to destination files to see if they should be copied.protected booleanYes, we can.Methods inherited from class Copy
add, add, addFileset, buildMap, buildMap, createFilterChain, createFilterSet, createMapper, doFileOperations, doResourceOperations, execute, getEncoding, getFileUtils, getFilterChains, getFilterSets, getForce, getOutputEncoding, getPreserveLastModified, isEnableMultipleMapping, setEnableMultipleMappings, setEncoding, setFailOnError, setFile, setFiltering, setFlatten, setForce, setGranularity, setIncludeEmptyDirs, setOutputEncoding, setOverwrite, setPreserveLastModified, setPreserveLastModified, setQuiet, setTodir, setTofile, setVerbose, validateAttributesModifier and TypeMethodDescriptionvoidadd(ResourceCollection res) Add a collection of files to copy.voidadd(FileNameMapper fileNameMapper) Add a nested filenamemapper.voidaddFileset(FileSet set) Add a set of files to copy.protected voidbuildMap(File fromDir, File toDir, String[] names, FileNameMapper mapper, Hashtable<String, String[]> map) Add to a map of files/directories to copy.buildMap(Resource[] fromResources, File toDir, FileNameMapper mapper) Create a map of resources to copy.Add a FilterChain.Add a filterset.Define the mapper to map source to destination files.protected voidActually does the file (and possibly empty directory) copies.protected voiddoResourceOperations(Map<Resource, String[]> map) Actually does the resource copies.voidexecute()Perform the copy operation.Get the character encoding to be used.protected FileUtilsGet the FileUtils for this task.protected Vector<FilterChain> Get the filterchains being applied to this operation.Get the filtersets being applied to this operation.booleangetForce()Whether read-only destinations will be overwritten.Get the character encoding for output files.booleanGet whether to give the copied files the same last modified time as the original files.booleanGet whether multiple mapping is enabled.voidsetEnableMultipleMappings(boolean enableMultipleMappings) Set method of handling mappers that return multiple mappings for a given source path.voidsetEncoding(String encoding) Set the character encoding.voidsetFailOnError(boolean failonerror) Set whether to fail when errors are encountered.voidSet a single source file to copy.voidsetFiltering(boolean filtering) Set filtering mode.voidsetFlatten(boolean flatten) Set whether files copied from directory trees will be "flattened" into a single directory.voidsetForce(boolean f) Whether read-only destinations will be overwritten.voidsetGranularity(long granularity) Set the number of milliseconds leeway to give before deciding a target is out of date.voidsetIncludeEmptyDirs(boolean includeEmpty) Set whether to copy empty directories.voidsetOutputEncoding(String encoding) Set the character encoding for output files.voidsetOverwrite(boolean overwrite) Set overwrite mode regarding existing destination file(s).voidsetPreserveLastModified(boolean preserve) Give the copied files the same last modified time as the original files.voidsetPreserveLastModified(String preserve) Deprecated.since 1.5.x.voidsetQuiet(boolean quiet) Set quiet mode.voidSet the destination directory.voidSet the destination file.voidsetVerbose(boolean verbose) Set verbose mode.protected voidEnsure we have a consistent and legal set of attributes, and set any internal flags necessary based on different combinations of attributes.Methods inherited from class Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeModifier and TypeMethodDescriptionfinal voidbindToOwner(Task owner) Bind a task to another; use this when configuring a newly created task to do work on behalf of another.Returns the container target of this task.Returns the wrapper used for runtime configuration.Returns the name to use in logging messages.Return the type of task.protected RuntimeConfigurableReturn the runtime configurable structure for this task.protected voidhandleErrorFlush(String output) Handles an error line by logging it with the WARN priority.protected voidhandleErrorOutput(String output) Handles an error output by logging it with the WARN priority.protected voidhandleFlush(String output) Handles output by logging it with the INFO priority.protected inthandleInput(byte[] buffer, int offset, int length) Handle an input request by this task.protected voidhandleOutput(String output) Handles output by logging it with the INFO priority.voidinit()Called by the project to let the task initialize properly.protected final booleanHas this task been marked invalid?voidLogs a message with the default (INFO) priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidConfigures this task - if it hasn't been done already.final voidperform()Performs this task if it's still valid, or gets a replacement version and performs that otherwise.voidForce the task to be reconfigured from its RuntimeConfigurable.voidsetOwningTarget(Target target) Sets the target container of this task.voidSets the wrapper to be used for runtime configuration.voidsetTaskName(String name) Sets the name to use in logging messages.voidsetTaskType(String type) Sets the name with which the task has been invoked.Methods inherited from class ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProjectModifier and TypeMethodDescriptionclone()Returns the description of the current action.Returns the file/location where this task was defined.Returns the project to which this component belongs.voidsetDescription(String desc) Sets a description of the current action.voidsetLocation(Location location) Sets the file/location where this task was defined.voidsetProject(Project project) Sets the project object of this component.
-
Constructor Details
-
MyCopy
public MyCopy()
-
-
Method Details
-
scan
Description copied from class:CopyCompares source files to destination files to see if they should be copied. -
scan
Description copied from class:CopyCompares source resources to destination files to see if they should be copied. -
getToDir
-
getIncludeEmptyDirs
public boolean getIncludeEmptyDirs()Get the includeEmptyDirs attribute.- Returns:
- true if emptyDirs are to be included
-
supportsNonFileResources
protected boolean supportsNonFileResources()Yes, we can.- Overrides:
supportsNonFileResourcesin classCopy- Returns:
- true always.
- Since:
- Ant 1.7
-