Record Class IvyResolver

java.lang.Object
java.lang.Record
org.copalis.jam.util.IvyResolver
Record Components:
url - the URL of the Ivy jar file
cacheDir - the path where the Ivy cache directory should be created
settingsFile - a specific file to use for Ivy settings
All Implemented Interfaces:
Serializable, PackageResolver

public record IvyResolver(String url, String cacheDir, File settingsFile) extends Record implements PackageResolver, Serializable
A wrapper for the Apache Ivy dependency manager
See Also:
  • Field Details

  • Constructor Details

    • IvyResolver

      public IvyResolver(String url, String cacheDir, File settingsFile)
      Creates an instance of a IvyResolver record class.
      Parameters:
      url - the value for the url record component
      cacheDir - the value for the cacheDir record component
      settingsFile - the value for the settingsFile record component
  • Method Details

    • ivyJar

      public Path ivyJar()
      Gets a reference to a local copy of the Ivy jar file
      Returns:
      the file path
    • resolve

      public Stream<Path> resolve(String... dependencies)
      Description copied from interface: PackageResolver
      Resolves dependencies
      Specified by:
      resolve in interface PackageResolver
      Parameters:
      dependencies - dependency identifiers in the format "org:name:revision". If org and name are the same, the format "name:revision" can be used instead.
      Returns:
      a stream of Path objects referencing the resolved dependencies
    • download

      public Stream<Path> download(File ivyFile, File settingsFile)
      Executes Ivy
      Parameters:
      ivyFile - an optional ivy.xml file
      settingsFile - an optional settings.xml file
      Returns:
      a stream of Path objects referencing the resolved dependencies
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • url

      public String url()
      Returns the value of the url record component.
      Returns:
      the value of the url record component
    • cacheDir

      public String cacheDir()
      Returns the value of the cacheDir record component.
      Returns:
      the value of the cacheDir record component
    • settingsFile

      public File settingsFile()
      Returns the value of the settingsFile record component.
      Returns:
      the value of the settingsFile record component