Class IvyCacheFileset

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
All Implemented Interfaces:
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.
  • Field Details

    • setid

      private String setid
  • Constructor Details

    • IvyCacheFileset

      public IvyCacheFileset()
  • Method Details

    • getSetid

      public String getSetid()
    • setSetid

      public void setSetid(String id)
    • setUseOrigin

      public void setUseOrigin(boolean useOrigin)
      Overrides:
      setUseOrigin in class IvyPostResolveTask
    • doExecute

      public void doExecute() throws org.apache.tools.ant.BuildException
      Description copied from class: IvyTask
      The real logic of task execution after project has been set in the context. MUST be implemented by subclasses
      Specified by:
      doExecute in class IvyTask
      Throws:
      org.apache.tools.ant.BuildException - if something goes wrong
    • requireCommonBaseDir

      File requireCommonBaseDir(List<ArtifactDownloadReport> artifactDownloadReports)
      Returns a common base directory, determined from the local files of the passed artifactDownloadReports. If no common base directory can be determined, this method throws a BuildException
      Parameters:
      artifactDownloadReports - The artifact download reports for which the common base directory of the artifacts has to be determined
      Returns:
      File
    • getPath

      private String getPath(File base, 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

      File getBaseDir(File file1, File file2)
      Returns the common base directory between the passed file1 and file2.

      The returned base directory will be a parent of both the file1 and file2 or it will be null.

      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 file1 and file2. Returns null if no common base directory could be determined or if either file1 or file2 is null
    • getParents

      private LinkedList<File> getParents(File file)
      Returns:
      a list of files, starting with the root and ending with the file itself