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:
java.lang.Cloneable
public class CopyTask extends AbstractSyncTask
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
-
-
Constructor Summary
Constructors Constructor Description CopyTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
isOverwrite()
boolean
isPreserveLastModified()
void
setOverwrite(boolean overwrite)
Enable/disable overwriting of up-to-date files.void
setPreserveLastModified(boolean preserveLastModified)
Enable/disable 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
-
-
-
-
Constructor Detail
-
CopyTask
public CopyTask()
-
-
Method Detail
-
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 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
-
-