Package org.apache.ivy.ant
Class IvyCacheFileset
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.apache.ivy.ant.IvyTask
-
- org.apache.ivy.ant.IvyPostResolveTask
-
- org.apache.ivy.ant.IvyCacheTask
-
- org.apache.ivy.ant.IvyCacheFileset
-
- All Implemented Interfaces:
java.lang.Cloneable
public class IvyCacheFileset extends IvyCacheTask
Creates an ant fileset consisting in all artifacts found during a resolve. Note that this task is not compatible with the useOrigin mode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classIvyCacheFileset.EmptyDirectoryScannerprivate static classIvyCacheFileset.EmptyFileSetprivate static classIvyCacheFileset.EmptyIterator<T>
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringsetid-
Fields inherited from class org.apache.ivy.ant.IvyTask
ANT_PROJECT_CONTEXT_KEY
-
-
Constructor Summary
Constructors Constructor Description IvyCacheFileset()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoExecute()The real logic of task execution after project has been set in the context.(package private) java.io.FilegetBaseDir(java.io.File file1, java.io.File file2)Returns the common base directory between the passedfile1andfile2.private java.util.LinkedList<java.io.File>getParents(java.io.File file)private java.lang.StringgetPath(java.io.File base, java.io.File file)Returns the path of the file relative to the given base directory.java.lang.StringgetSetid()(package private) java.io.FilerequireCommonBaseDir(java.util.List<ArtifactDownloadReport> artifactDownloadReports)Returns a common base directory, determined from thelocal filesof the passedartifactDownloadReports.voidsetSetid(java.lang.String id)voidsetUseOrigin(boolean useOrigin)-
Methods inherited from class org.apache.ivy.ant.IvyCacheTask
getArtifactReports
-
Methods inherited from class org.apache.ivy.ant.IvyPostResolveTask
createConflict, createDependency, createExclude, ensureResolved, getArtifactFilter, getBranch, getConf, getConfsToResolve, getConfsToResolve, getFile, getLog, getModule, getOrganisation, getResolvedModuleId, getResolvedMrid, getResolvedReport, getResolveId, getResolveMode, getRevision, getType, isChanging, isHaltonfailure, isInline, isKeep, isRefresh, isTransitive, isUseOrigin, prepareAndCheck, setBranch, setCache, setChanging, setConf, setFile, setHaltonfailure, setInline, setKeep, setLog, setModule, setOrganisation, setRefresh, setResolveId, setResolveMode, setRevision, setTransitive, setType, setupResolve
-
Methods inherited from class org.apache.ivy.ant.IvyTask
cacheAttributeNotSupported, doValidate, execute, finalizeTask, getIvyInstance, getProperty, getProperty, getProperty, getProperty, getPubDate, getResolvedConfigurations, getResolvedDescriptor, getResolvedDescriptor, getResolvedDescriptor, getResolvedDescriptor, getResolvedReport, getSettings, getSettingsRef, isValidate, mergeConfs, prepareTask, setResolved, setResolved, setSettingsRef, setValidate, splitConfs, toString
-
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
-
-
-
-
Method Detail
-
getSetid
public java.lang.String getSetid()
-
setSetid
public void setSetid(java.lang.String id)
-
setUseOrigin
public void setUseOrigin(boolean useOrigin)
- Overrides:
setUseOriginin classIvyPostResolveTask
-
doExecute
public void doExecute() throws org.apache.tools.ant.BuildExceptionDescription copied from class:IvyTaskThe real logic of task execution after project has been set in the context. MUST be implemented by subclasses
-
requireCommonBaseDir
java.io.File requireCommonBaseDir(java.util.List<ArtifactDownloadReport> artifactDownloadReports)
Returns a common base directory, determined from thelocal filesof the passedartifactDownloadReports. If no common base directory can be determined, this method throws aBuildException- Parameters:
artifactDownloadReports- The artifact download reports for which the common base directory of the artifacts has to be determined- Returns:
- File
-
getPath
private java.lang.String getPath(java.io.File base, java.io.File file)Returns the path of the file relative to the given base directory.- Parameters:
base- the parent directory to which the file must be evaluated.file- the file for which the path should be returned- Returns:
- the path of the file relative to the given base directory.
-
getBaseDir
java.io.File getBaseDir(java.io.File file1, java.io.File file2)Returns the common base directory between the passedfile1andfile2.The returned base directory will be a parent of both the
file1andfile2or it will benull.- Parameters:
file1- One of the files, for which the common base directory is being sought, may be null.file2- The other file for which the common base directory should be returned, may be null.- Returns:
- the common base directory between a
file1andfile2. Returns null if no common base directory could be determined or if eitherfile1orfile2is null
-
getParents
private java.util.LinkedList<java.io.File> getParents(java.io.File file)
- Returns:
- a list of files, starting with the root and ending with the file itself
-
-