Class LicenseDownloader

java.lang.Object
org.codehaus.mojo.license.download.LicenseDownloader
All Implemented Interfaces:
AutoCloseable

public class LicenseDownloader extends Object implements AutoCloseable
Utilities for downloading remote license files.
Since:
1.0
Author:
pgier
  • Constructor Details

  • Method Details

    • downloadLicense

      public LicenseDownloader.LicenseDownloadResult downloadLicense(String licenseUrlString, FileNameEntry fileNameEntry) throws IOException, URISyntaxException, org.apache.maven.plugin.MojoFailureException
      Downloads a license file from the given 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.
      Parameters:
      licenseUrlString - the URL
      fileNameEntry - a hint where to store the license file
      Returns:
      the path to the file where the downloaded license file was stored
      Throws:
      IOException
      URISyntaxException
      org.apache.maven.plugin.MojoFailureException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • calculateStringChecksum

      public static String calculateStringChecksum(String contentString)