public class LicenseDownloader extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
LicenseDownloader.LicenseDownloadResult
A result of a license download operation.
|
| Constructor and Description |
|---|
LicenseDownloader(org.apache.maven.settings.Proxy proxy,
int connectTimeout,
int socketTimeout,
int connectionRequestTimeout,
Map<String,SpdxLicenseList.Attachments.ContentSanitizer> contentSanitizers,
Charset charset) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
LicenseDownloader.LicenseDownloadResult |
downloadLicense(String licenseUrlString,
FileNameEntry fileNameEntry,
org.apache.maven.plugin.logging.Log log)
Downloads a license file from the given
licenseUrlString stores it locally and
returns the local path where the license file was stored. |
public LicenseDownloader(org.apache.maven.settings.Proxy proxy,
int connectTimeout,
int socketTimeout,
int connectionRequestTimeout,
Map<String,SpdxLicenseList.Attachments.ContentSanitizer> contentSanitizers,
Charset charset)
public LicenseDownloader.LicenseDownloadResult downloadLicense(String licenseUrlString, FileNameEntry fileNameEntry, org.apache.maven.plugin.logging.Log log) throws IOException, URISyntaxException, org.apache.maven.plugin.MojoFailureException
licenseUrlString stores it locally and
returns the local path where the license file was stored. Note that the
outputFile name can be further modified by this method, esp. the file extension
can be adjusted based on the mime type of the HTTP response.licenseUrlString - the URLoutputFile - a hint where to store the license filelog - IOExceptionURISyntaxExceptionorg.apache.maven.plugin.MojoFailureExceptionpublic void close()
throws IOException
close in interface AutoCloseableIOExceptionCopyright © 2010–2019 MojoHaus. All rights reserved.