API Overview API Index Package Overview Direct link to this page
Apache Ant 1.7.1
  org.apache.tools.ant.taskdefs. Copy View Source
Author(s)
Since
Ant 1.2
Version
Serial
Hierarchy
 Object
      ProjectComponent
          Task
              Copy
Implements
Subclasses
Description
public class Copy
  Copies a file or directory to a new file or directory.
See also:   
Constructors
public Copy ()
Copy task constructor.
Methods
Hide/Show inherited methods
public void add (FileNameMapper fileNameMapper)
  Add a nested filenamemapper.
public void add (ResourceCollection res)
  Add a collection of files to copy.
public void addFileset (FileSet set)
  Add a set of files to copy.
publicfinal void bindToOwner (Task owner) [Inherited From Task]
  Bind a task to another; use this when configuring a newly created task to do work on behalf of another.
protected void buildMap (java.io.File fromDir, java.io.File toDir, java.lang.String names, FileNameMapper mapper, java.util.Hashtable map)
  Add to a map of files/directories to copy.
protected java.util.Map buildMap (Resource fromResources, java.io.File toDir, FileNameMapper mapper)
  Create a map of resources to copy.
public java.lang.Object clone () throws java.lang.CloneNotSupportedException [Inherited From ProjectComponent]
 
public FilterChain createFilterChain ()
  Add a FilterChain.
public FilterSet createFilterSet ()
  Add a filterset.
public Mapper createMapper () throws BuildException
  Define the mapper to map source to destination files.
protected void doFileOperations ()
  Actually does the file (and possibly empty directory) copies.
protected void doResourceOperations (java.util.Map map)
  Actually does the resource copies.
public void execute () throws BuildException [Overrides Task]
  Perform the copy operation.
public java.lang.String getDescription () [Inherited From ProjectComponent]
  Returns the description of the current action.
public java.lang.String getEncoding ()
  Get the character encoding to be used.
protected FileUtils getFileUtils ()
  Get the FileUtils for this task.
protected java.util.Vector getFilterChains ()
  Get the filterchains being applied to this operation.
protected java.util.Vector getFilterSets ()
  Get the filtersets being applied to this operation.
public Location getLocation () [Inherited From ProjectComponent]
  Returns the file/location where this task was defined.
public java.lang.String getOutputEncoding ()
  Get the character encoding for output files.
public Target getOwningTarget () [Inherited From Task]
  Returns the container target of this task.
public boolean getPreserveLastModified ()
  Get whether to give the copied files the same last modified time as the original files.
public Project getProject () [Inherited From ProjectComponent]
  Returns the project to which this component belongs.
public RuntimeConfigurable getRuntimeConfigurableWrapper () [Inherited From Task]
  Returns the wrapper used for runtime configuration.
public java.lang.String getTaskName () [Inherited From Task]
  Returns the name to use in logging messages.
public java.lang.String getTaskType () [Inherited From Task]
  Return the type of task.
protected RuntimeConfigurable getWrapper () [Inherited From Task]
  Return the runtime configurable structure for this task.
protected void handleErrorFlush (java.lang.String output) [Inherited From Task]
  Handles an error line by logging it with the WARN priority.
protected void handleErrorOutput (java.lang.String output) [Inherited From Task]
  Handles an error output by logging it with the WARN priority.
protected void handleFlush (java.lang.String output) [Inherited From Task]
  Handles output by logging it with the INFO priority.
protected int handleInput (byte[] buffer, int offset, int length) throws java.io.IOException [Inherited From Task]
  Handle an input request by this task.
protected void handleOutput (java.lang.String output) [Inherited From Task]
  Handles output by logging it with the INFO priority.
public void init () throws BuildException [Inherited From Task]
  Called by the project to let the task initialize properly.
public boolean isEnableMultipleMapping ()
  Get whether multiple mapping is enabled.
protectedfinal boolean isInvalid () [Inherited From Task]
  Has this task been marked invalid?
public void log (java.lang.String msg) [Inherited From Task]
  Logs a message with the default (INFO) priority.
public void log (java.lang.String msg, int msgLevel) [Inherited From Task]
  Logs a message with the given priority.
public void log (java.lang.String msg, java.lang.Throwable t, int msgLevel) [Inherited From Task]
  Logs a message with the given priority.
public void log (java.lang.Throwable t, int msgLevel) [Inherited From Task]
  Logs a message with the given priority.
public void maybeConfigure () throws BuildException [Inherited From Task]
  Configures this task - if it hasn't been done already.
publicfinal void perform () [Inherited From Task]
  Performs this task if it's still valid, or gets a replacement version and performs that otherwise.
public void reconfigure () [Inherited From Task]
Force the task to be reconfigured from its RuntimeConfigurable.
protected void scan (java.io.File fromDir, java.io.File toDir, java.lang.String files, java.lang.String dirs)
  Compares source files to destination files to see if they should be copied.
protected java.util.Map scan (Resource fromResources, java.io.File toDir)
  Compares source resources to destination files to see if they should be copied.
public void setDescription (java.lang.String desc) [Inherited From ProjectComponent]
  Sets a description of the current action.
public void setEnableMultipleMappings (boolean enableMultipleMappings)
  Set method of handling mappers that return multiple mappings for a given source path.
public void setEncoding (java.lang.String encoding)
  Set the character encoding.
public void setFailOnError (boolean failonerror)
  Set whether to fail when errors are encountered.
public void setFile (java.io.File file)
  Set a single source file to copy.
public void setFiltering (boolean filtering)
  Set filtering mode.
public void setFlatten (boolean flatten)
  Set whether files copied from directory trees will be "flattened" into a single directory.
public void setGranularity (long granularity)
  Set the number of milliseconds leeway to give before deciding a target is out of date.
public void setIncludeEmptyDirs (boolean includeEmpty)
  Set whether to copy empty directories.
public void setLocation (Location location) [Inherited From ProjectComponent]
  Sets the file/location where this task was defined.
public void setOutputEncoding (java.lang.String encoding)
  Set the character encoding for output files.
public void setOverwrite (boolean overwrite)
  Set overwrite mode regarding existing destination file(s).
public void setOwningTarget (Target target) [Inherited From Task]
  Sets the target container of this task.
public void setPreserveLastModified (boolean preserve)
  Give the copied files the same last modified time as the original files.
public void setPreserveLastModified (java.lang.String preserve)
  Give the copied files the same last modified time as the original files.
public void setProject (Project project) [Inherited From ProjectComponent]
  Sets the project object of this component.
public void setRuntimeConfigurableWrapper (RuntimeConfigurable wrapper) [Inherited From Task]
  Sets the wrapper to be used for runtime configuration.
public void setTaskName (java.lang.String name) [Inherited From Task]
  Sets the name to use in logging messages.
public void setTaskType (java.lang.String type) [Inherited From Task]
  Sets the name with which the task has been invoked.
public void setTodir (java.io.File destDir)
  Set the destination directory.
public void setTofile (java.io.File destFile)
  Set the destination file.
public void setVerbose (boolean verbose)
  Set verbose mode.
protected boolean supportsNonFileResources ()
  Whether this task can deal with non-file resources.
protected void validateAttributes () throws BuildException
  Ensure we have a consistent and legal set of attributes, and set any internal flags necessary based on different combinations of attributes.
Fields
Hide/Show inherited fields
protected java.util.Hashtable completeDirMap
protected java.lang.String description [Inherited From ProjectComponent]
Description of this component, if any.
protected java.io.File destDir
protected java.io.File destFile
protected java.util.Hashtable dirCopyMap
protected boolean failonerror
protected java.io.File file
protected java.util.Hashtable fileCopyMap
protected FileUtils fileUtils
protected boolean filtering
protected boolean flatten
protected boolean forceOverwrite
protected boolean includeEmpty
pack-privatefinalstatic java.lang.String LINE_SEPARATOR
protected Location location [Inherited From ProjectComponent]
Location within the build file of this task definition.
protected Mapper mapperElement
pack-privatefinalstatic java.io.File NULL_FILE_PLACEHOLDER
protected boolean preserveLastModified
protected Project project [Inherited From ProjectComponent]
Project object of this component.
protected java.util.Vector rcs
protected Target target [Inherited From Task]
Target this task belongs to, if any.
protected java.lang.String taskName [Inherited From Task]
  Name of this task to be used for logging purposes.
protected java.lang.String taskType [Inherited From Task]
Type of this task.
protected int verbosity
protected RuntimeConfigurable wrapper [Inherited From Task]
Wrapper for this object, used to configure it at runtime.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar