public abstract class AbstractSyncTask extends VfsTask
Modifier and Type | Class and Description |
---|---|
static class |
AbstractSyncTask.SourceInfo
Information about a source file.
|
Constructor and Description |
---|
AbstractSyncTask() |
Modifier and Type | Method and Description |
---|---|
void |
addConfiguredSrc(AbstractSyncTask.SourceInfo srcInfo)
Adds a nested <src> element.
|
protected boolean |
detectMissingSourceFiles()
Check if this task cares about destination files with a missing source file.
|
void |
execute()
Executes this task.
|
protected void |
handleMissingSourceFile(FileObject destFile)
Handles a destination for which there is no corresponding source file.
|
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 |
isFailonerror()
Sets whether we should fail if there was an error or not.
|
protected void |
logOrDie(String message,
int level) |
void |
setDestDir(String destDir)
Sets the destination directory.
|
void |
setDestFile(String destFile)
Sets the destination file.
|
void |
setFailonerror(boolean failonerror)
Sets whether we should fail if there was an error or not.
|
void |
setIncludes(String filesList)
Sets the files to includes.
|
void |
setSrc(String srcFile)
Sets the source file.
|
void |
setSrcDir(String srcDir)
Sets the source directory.
|
void |
setSrcDirIsBase(boolean srcDirIsBase)
Sets whether the source directory should be consider as the base directory.
|
closeManager, resolveFile
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
public void setDestFile(String destFile)
destFile
- The destination file name.public void setDestDir(String destDir)
destDir
- The destination directory.public void setSrc(String srcFile)
srcFile
- The source file name.public void setSrcDir(String srcDir)
srcDir
- The source directory.public void setSrcDirIsBase(boolean srcDirIsBase)
srcDirIsBase
- true if the source directory is the base directory.public void setFailonerror(boolean failonerror)
failonerror
- true if the operation should fail if there is an error.public boolean isFailonerror()
public void setIncludes(String filesList)
filesList
- The list of files to include.public void addConfiguredSrc(AbstractSyncTask.SourceInfo srcInfo) throws org.apache.tools.ant.BuildException
srcInfo
- A nested source element.org.apache.tools.ant.BuildException
- if the SourceInfo doesn't reference a file.public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- if an error occurs.protected void logOrDie(String message, int level)
protected void handleOutOfDateFile(FileObject srcFile, FileObject destFile) throws Exception
This is a file where the destination file either doesn't exist, or is older than the source file.
This implementation does nothing.
srcFile
- The source file.destFile
- The destination file.Exception
- Implementation can throw any Exception.protected void handleUpToDateFile(FileObject srcFile, FileObject destFile) throws Exception
This is where the destination file exists and is newer than the source file.
This implementation does nothing.
srcFile
- The source file.destFile
- The destination file.Exception
- Implementation can throw any Exception.protected void handleMissingSourceFile(FileObject destFile) throws Exception
This implementation does nothing.
destFile
- The existing destination file.Exception
- Implementation can throw any Exception.protected boolean detectMissingSourceFiles()
This implementation returns false.
Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.