Package org.apache.commons.vfs2.tasks
Class CopyTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.commons.vfs2.tasks.VfsTask
org.apache.commons.vfs2.tasks.AbstractSyncTask
org.apache.commons.vfs2.tasks.CopyTask
- All Implemented Interfaces:
Cloneable
An Ant task that copies matching files.
TODO - Copy folders that do not contain files.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.vfs2.tasks.AbstractSyncTask
AbstractSyncTask.SourceInfo
-
Field Summary
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
handleOutOfDateFile
(FileObject srcFile, FileObject destFile) Handles an out-of-date file.protected void
handleUpToDateFile
(FileObject srcFile, FileObject destFile) Handles an up-to-date file.boolean
Tests whether overwrite is enabled.boolean
Tests whether preserve last modified is enabled.void
setOverwrite
(boolean overwrite) Enable/disable overwriting of up-to-date files.void
setPreserveLastModified
(boolean preserveLastModified) Sets preserving last modified time of copied files.Methods inherited from class org.apache.commons.vfs2.tasks.AbstractSyncTask
addConfiguredSrc, detectMissingSourceFiles, execute, handleMissingSourceFile, isFailonerror, logOrDie, setDestDir, setDestFile, setFailonerror, setIncludes, setSrc, setSrcDir, setSrcDirIsBase
Methods inherited from class org.apache.commons.vfs2.tasks.VfsTask
closeManager, resolveFile
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
CopyTask
public CopyTask()Constructs a new instance.
-
-
Method Details
-
handleOutOfDateFile
protected void handleOutOfDateFile(FileObject srcFile, FileObject destFile) throws FileSystemException Handles an out-of-date file.- Overrides:
handleOutOfDateFile
in classAbstractSyncTask
- 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 classAbstractSyncTask
- Parameters:
srcFile
- The source FileObject.destFile
- The destination FileObject.- Throws:
FileSystemException
-
isOverwrite
Tests whether overwrite is enabled.- Returns:
- the current value of overwrite
-
isPreserveLastModified
Tests whether preserve last modified is enabled.- Returns:
- the current value of preserveLastModified
-
setOverwrite
Enable/disable overwriting of up-to-date files.- Parameters:
overwrite
- true if the file should be overwritten.
-
setPreserveLastModified
Sets preserving last modified time of copied files.- Parameters:
preserveLastModified
- true if the last modified time should be preserved.
-