Package enterprises.iwakura.amber
Interface DependencyDownloader
- All Known Implementing Classes:
MavenDependencyDownloader
public interface DependencyDownloader
Interface for downloading dependencies and their checksums from repositories.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA default User-Agent string for HTTP requests to identify the Amber library. -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<RepositoryType, DependencyDownloader> Provides a map of default downloaders for each supported repository type.downloadChecksum(Dependency dependency, Repository repository, ChecksumType checksumType) Downloads the checksum for the specified dependency from the given repository.downloadJar(Dependency dependency, Repository repository, Path filePath) Downloads the jar file for the specified dependency from the given repository and saves it to the specified file path.
-
Field Details
-
USER_AGENT
A default User-Agent string for HTTP requests to identify the Amber library.
-
-
Method Details
-
defaultDownloaders
Provides a map of default downloaders for each supported repository type.- Returns:
- A map associating each
RepositoryTypewith its correspondingDependencyDownloader.
-
downloadJar
DownloadResult downloadJar(Dependency dependency, Repository repository, Path filePath) throws IOException Downloads the jar file for the specified dependency from the given repository and saves it to the specified file path.- Parameters:
dependency- the dependency to downloadrepository- the repository to download fromfilePath- the path to save the downloaded jar file- Returns:
- a
DownloadResultindicating the success or failure of the download - Throws:
IOException- if an I/O error occurs during the download
-
downloadChecksum
StringDownloadResult downloadChecksum(Dependency dependency, Repository repository, ChecksumType checksumType) throws IOException Downloads the checksum for the specified dependency from the given repository.- Parameters:
dependency- the dependency to download the checksum forrepository- the repository to download fromchecksumType- the type of checksum to download (e.g., MD5, SHA-1, SHA-256)- Returns:
- a
StringDownloadResultcontaining the checksum string if successful, or an error message if failed - Throws:
IOException- if an I/O error occurs during the download
-