-
- All Implemented Interfaces:
-
kotlin.Comparable
public final class DownloadRequest implements Comparable<DownloadRequest>
This class represents a request for downloading which contains necessary configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classDownloadRequest.Builder
-
Field Summary
Fields Modifier and Type Field Description private Downloaderdownloader
-
Method Summary
Modifier and Type Method Description final DownloadergetDownloader()final UnitsetDownloader(Downloader downloader)IntegercompareTo(DownloadRequest other)final UnitrootDownloadDir(String rootDownloadDir)Config root download directory of current app, called by DownloadManager. final Uriuri()Get the URL of this request. final UnitupdateDestinationFilepath(String filename)Update absolute filepath according to the directory and filename. final StringdestinationFilepath()Get destination filepath of this download request. final Unitfinish()Notifies the download request queue that this request has finished(successfully or fail) -
-
Method Detail
-
getDownloader
final Downloader getDownloader()
-
setDownloader
final Unit setDownloader(Downloader downloader)
-
compareTo
Integer compareTo(DownloadRequest other)
-
rootDownloadDir
final Unit rootDownloadDir(String rootDownloadDir)
Config root download directory of current app, called by DownloadManager.
- Parameters:
rootDownloadDir- root download dir
-
updateDestinationFilepath
final Unit updateDestinationFilepath(String filename)
Update absolute filepath according to the directory and filename.
- Parameters:
filename- filename to save
-
destinationFilepath
final String destinationFilepath()
Get destination filepath of this download request.
-
-
-
-