Class DefaultDownloadManager
- java.lang.Object
-
- org.apache.maven.shared.io.download.DefaultDownloadManager
-
- All Implemented Interfaces:
DownloadManager
public class DefaultDownloadManager extends java.lang.Object implements DownloadManager
The Implementation of theDownloadManager
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringROLE_HINTRole hint.-
Fields inherited from interface org.apache.maven.shared.io.download.DownloadManager
ROLE
-
-
Constructor Summary
Constructors Constructor Description DefaultDownloadManager()Deprecated.The no-arg constructor creates a DefaultDownloadManager that is completely non-functional and cannot download anything without aWagonManager.DefaultDownloadManager(org.apache.maven.artifact.manager.WagonManager wagonManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()Deletes the temporary files downloaded through this manager and empties its cache, so that subsequent requests download again.java.io.Filedownload(java.lang.String url, java.util.List<org.apache.maven.wagon.events.TransferListener> transferListeners, MessageHolder messageHolder)java.io.Filedownload(java.lang.String url, MessageHolder messageHolder)
-
-
-
Field Detail
-
ROLE_HINT
public static final java.lang.String ROLE_HINT
Role hint.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultDownloadManager
@Deprecated public DefaultDownloadManager()
Deprecated.The no-arg constructor creates a DefaultDownloadManager that is completely non-functional and cannot download anything without aWagonManager. UseDefaultDownloadManager(WagonManager)instead.Create an instance of theDefaultDownloadManager.
-
DefaultDownloadManager
public DefaultDownloadManager(org.apache.maven.artifact.manager.WagonManager wagonManager)
- Parameters:
wagonManager-WagonManager
-
-
Method Detail
-
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 java.io.File download(java.lang.String url, MessageHolder messageHolder) throws DownloadFailedException- Specified by:
downloadin interfaceDownloadManager- Parameters:
url- The URL.messageHolder-MessageHolder- Returns:
File- Throws:
DownloadFailedException- in case of exception.
-
download
public java.io.File download(java.lang.String url, java.util.List<org.apache.maven.wagon.events.TransferListener> transferListeners, MessageHolder messageHolder) throws DownloadFailedException- Specified by:
downloadin interfaceDownloadManager- Parameters:
url- The URL.transferListeners-TransferListenermessageHolder-MessageHolder- Returns:
File- Throws:
DownloadFailedException- in case of exception.
-
-