Class Repository

java.lang.Object
enterprises.iwakura.amber.Repository

public class Repository extends Object
Represents a repository from which dependencies can be downloaded.
  • Constructor Details

    • Repository

      public Repository()
  • Method Details

    • getDownloadPathDirectory

      public String getDownloadPathDirectory(Dependency dependency)
      Generates the download path directory for a given dependency. The path is constructed based on the repository URL, group ID, name, and version of the dependency. If you need the precise JAR file path, use getJarDownloadPath(Dependency, String).
      Parameters:
      dependency - the dependency for which to generate the download path
      Returns:
      the download path directory as a String
    • getJarDownloadPath

      public String getJarDownloadPath(Dependency dependency, String versionOverride)
      Generates the full download path for the JAR file of a given dependency, including the filename. This method allows for an optional version override, which can be useful for handling snapshot versions or other special cases. Uses getDownloadPathDirectory(Dependency) to construct the directory part of the path.
      Parameters:
      dependency - the dependency for which to generate the JAR download path
      versionOverride - an optional version to override the dependency's version; if null, the dependency's version is used
      Returns:
      the full JAR download path as a String
    • getChecksumDownloadPath

      public String getChecksumDownloadPath(Dependency dependency, String versionOverride, ChecksumType checksumType)
      Generates the full download path for the checksum file of a given dependency's JAR file. This method uses getJarDownloadPath(Dependency, String) and appends the appropriate checksum file extension based on the specified checksum type.
      Parameters:
      dependency - the dependency for which to generate the checksum download path
      versionOverride - an optional version to override the dependency's version; if null, the dependency's version is used
      checksumType - the type of checksum (e.g., MD5, SHA-1, SHA-256)
      Returns:
      the full checksum download path as a String