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()
Constructs a new instance.
|
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)
Logs a message or throws a
BuildException depending on isFailonerror() . |
void |
setDestDir(String destDirUrl)
Sets the destination directory.
|
void |
setDestFile(String destFileUrl)
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 srcDirUrl)
Sets the source directory.
|
void |
setSrcDirIsBase(boolean srcDirIsBase)
Sets whether the source directory should be considered as the base directory.
|
closeManager, resolveFile
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
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.protected boolean detectMissingSourceFiles()
This implementation returns false.
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 handleMissingSourceFile(FileObject destFile) throws Exception
This implementation does nothing.
destFile
- The existing destination file.Exception
- Implementation can throw any Exception.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.public boolean isFailonerror()
protected void logOrDie(String message, int level)
BuildException
depending on isFailonerror()
.message
- The message to using in logging or BuildException.level
- The log level.public void setDestDir(String destDirUrl)
destDirUrl
- The destination directory.public void setDestFile(String destFileUrl)
destFileUrl
- The destination file name.public void setFailonerror(boolean failOnError)
failOnError
- true if the operation should fail if there is an error.public void setIncludes(String filesList)
filesList
- The list of files to include.public void setSrc(String srcFile)
srcFile
- The source file name.public void setSrcDir(String srcDirUrl)
srcDirUrl
- The source directory.public void setSrcDirIsBase(boolean srcDirIsBase)
srcDirIsBase
- true if the source directory is the base directory.Copyright © 2002–2025 The Apache Software Foundation. All rights reserved.