|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.commons.vfs.tasks.VfsTask
org.apache.commons.vfs.tasks.AbstractSyncTask
public abstract class AbstractSyncTask
An abstract file synchronization task. Scans a set of source files and folders, and a destination folder, and performs actions on missing and out-of-date files. Specifically, performs actions on the following:
Nested Class Summary | |
---|---|
static class |
AbstractSyncTask.SourceInfo
Information about a source file. |
Field Summary | |
---|---|
private java.lang.String |
destDirUrl
|
private java.lang.String |
destFileUrl
|
private boolean |
failonerror
|
private java.lang.String |
filesList
|
private boolean |
srcDirIsBase
|
private java.lang.String |
srcDirUrl
|
private java.util.ArrayList |
srcFiles
|
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 | |
---|---|
AbstractSyncTask()
|
Method Summary | |
---|---|
void |
addConfiguredSrc(AbstractSyncTask.SourceInfo srcInfo)
Adds a nested |
protected boolean |
detectMissingSourceFiles()
Check if this task cares about destination files with a missing source file. |
void |
execute()
Executes this task. |
private void |
handleFile(FileObject srcFile,
FileObject destFile)
Handles a single source file. |
private void |
handleFile(java.util.Set destFiles,
FileObject srcFile,
FileObject destFile)
Handles a single file, checking for collisions where more than one source file maps to the same destination file. |
private void |
handleFiles()
Copies the source files to the destination. |
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 (a file where the destination file either doesn't exist, or is older than the source file). |
private void |
handleSingleFile()
Copies a single file. |
protected void |
handleUpToDateFile(FileObject srcFile,
FileObject destFile)
Handles an up-to-date file (where the destination file exists and is newer than the source file). |
boolean |
isFailonerror()
Sets whether we should fail if there was an error or not |
protected void |
logOrDie(java.lang.String message,
int level)
|
void |
setDestDir(java.lang.String destDir)
Sets the destination directory. |
void |
setDestFile(java.lang.String destFile)
Sets the destination file. |
void |
setFailonerror(boolean failonerror)
Sets whether we should fail if there was an error or not |
void |
setIncludes(java.lang.String filesList)
Sets the files to includes |
void |
setSrc(java.lang.String srcFile)
Sets the source file |
void |
setSrcDir(java.lang.String srcDir)
Sets the source directory |
void |
setSrcDirIsBase(boolean srcDirIsBase)
Sets whether the source directory should be consider as the base directory. |
Methods inherited from class org.apache.commons.vfs.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 |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.ArrayList srcFiles
private java.lang.String destFileUrl
private java.lang.String destDirUrl
private java.lang.String srcDirUrl
private boolean srcDirIsBase
private boolean failonerror
private java.lang.String filesList
Constructor Detail |
---|
public AbstractSyncTask()
Method Detail |
---|
public void setDestFile(java.lang.String destFile)
public void setDestDir(java.lang.String destDir)
public void setSrc(java.lang.String srcFile)
public void setSrcDir(java.lang.String srcDir)
public void setSrcDirIsBase(boolean srcDirIsBase)
public void setFailonerror(boolean failonerror)
public boolean isFailonerror()
public void setIncludes(java.lang.String filesList)
public void addConfiguredSrc(AbstractSyncTask.SourceInfo srcInfo) throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
protected void logOrDie(java.lang.String message, int level)
private void handleFiles() throws java.lang.Exception
java.lang.Exception
private void handleFile(java.util.Set destFiles, FileObject srcFile, FileObject destFile) throws java.lang.Exception
java.lang.Exception
private void handleSingleFile() throws java.lang.Exception
java.lang.Exception
private void handleFile(FileObject srcFile, FileObject destFile) throws java.lang.Exception
java.lang.Exception
protected void handleOutOfDateFile(FileObject srcFile, FileObject destFile) throws java.lang.Exception
java.lang.Exception
protected void handleUpToDateFile(FileObject srcFile, FileObject destFile) throws java.lang.Exception
java.lang.Exception
protected void handleMissingSourceFile(FileObject destFile) throws java.lang.Exception
java.lang.Exception
protected boolean detectMissingSourceFiles()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |