Class DriverDownloader
java.lang.Object
com.darkcollective.relix.processor.connector.internal.DriverDownloader
Downloads driver
Artifacts into the driver directory,
verifying each against its SHA-256 before it is trusted.
An artifact is a URL and a digest, so this works the same for a JDBC driver and for a connector plugin's JARs — the two callers of it.
Integrity is mandatory: a byte stream whose digest does not match the manifest is rejected (never written), so a tampered mirror or a corrupted transfer cannot install a driver. An artifact already present with a matching checksum is skipped, so provisioning is idempotent. Writes are atomic (download to a temp file, verify, then move into place).
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DriverDownloader
- Parameters:
targetDirectory- the directory to download JARs into (created if absent)fetcher- the byte-fetching seam
-
-
Method Details
-
download
Downloads a list of artifacts into the target directory (creating it), each verified against its SHA-256. Shared by driver and connector-plugin provisioning.- Parameters:
artifacts- the artifacts to download- Returns:
- the paths of the downloaded (or already-present) JARs
- Throws:
IOException- if a download fails or a checksum does not match
-