Class DefaultDownloadManager

java.lang.Object
org.apache.maven.shared.io.download.DefaultDownloadManager
All Implemented Interfaces:
DownloadManager

public class DefaultDownloadManager extends Object implements DownloadManager
The Implementation of the DownloadManager
  • Field Details

  • Constructor Details

    • DefaultDownloadManager

      @Deprecated public DefaultDownloadManager()
      Deprecated.
      The no-arg constructor creates a DefaultDownloadManager that is completely non-functional and cannot download anything without a WagonManager. Use DefaultDownloadManager(WagonManager) instead.
      Create an instance of the DefaultDownloadManager.
    • DefaultDownloadManager

      public DefaultDownloadManager(org.apache.maven.artifact.manager.WagonManager wagonManager)
      Parameters:
      wagonManager - WagonManager
  • Method Details

    • cleanup

      public void cleanup()
      Deletes the temporary files downloaded through this manager and empties its cache, so that subsequent requests download again. Calling this is optional: the files are removed when the JVM exits anyway. It is worth calling in a long-lived JVM, such as a Maven daemon or an embedded build, once the downloaded files are no longer needed. Do not call it while a download is in progress on another thread, as that download writes into the directory being removed.
    • download

      public File download(String url, MessageHolder messageHolder) throws DownloadFailedException
      Specified by:
      download in interface DownloadManager
      Parameters:
      url - The URL.
      messageHolder - MessageHolder
      Returns:
      File
      Throws:
      DownloadFailedException - in case of exception.
    • download

      public File download(String url, List<org.apache.maven.wagon.events.TransferListener> transferListeners, MessageHolder messageHolder) throws DownloadFailedException
      Specified by:
      download in interface DownloadManager
      Parameters:
      url - The URL.
      transferListeners - TransferListener
      messageHolder - MessageHolder
      Returns:
      File
      Throws:
      DownloadFailedException - in case of exception.