Class CopyTask

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
MoveTask, SyncTask

public class CopyTask extends AbstractSyncTask
An Ant task that copies matching files.

TODO - Copy folders that do not contain files.

  • Field Details

    • overwrite

      private boolean overwrite
    • preserveLastModified

      private boolean preserveLastModified
  • Constructor Details

    • CopyTask

      public CopyTask()
  • Method Details

    • setOverwrite

      public void setOverwrite(boolean overwrite)
      Enable/disable overwriting of up-to-date files.
      Parameters:
      overwrite - true if the file should be overwritten.
    • setPreserveLastModified

      public void setPreserveLastModified(boolean preserveLastModified)
      Enable/disable preserving last modified time of copied files.
      Parameters:
      preserveLastModified - true if the last modified time should be preserved.
    • isOverwrite

      public boolean isOverwrite()
      Returns:
      the current value of overwrite
    • isPreserveLastModified

      public boolean isPreserveLastModified()
      Returns:
      the current value of preserveLastModified
    • handleOutOfDateFile

      protected void handleOutOfDateFile(FileObject srcFile, FileObject destFile) throws FileSystemException
      Handles an out-of-date file.
      Overrides:
      handleOutOfDateFile in class AbstractSyncTask
      Parameters:
      srcFile - The source FileObject.
      destFile - The destination FileObject.
      Throws:
      FileSystemException
    • handleUpToDateFile

      protected void handleUpToDateFile(FileObject srcFile, FileObject destFile) throws FileSystemException
      Handles an up-to-date file.
      Overrides:
      handleUpToDateFile in class AbstractSyncTask
      Parameters:
      srcFile - The source FileObject.
      destFile - The destination FileObject.
      Throws:
      FileSystemException