Package javadl
Class Downloader
java.lang.Object
javadl.Downloader
Main class where you must create downloads and manage them.
Create it with the custom DownloadHandler to start receiving Download events.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondownloadFileToLocation(String urlStr, File file) This method downloads the file asynchronously, executing it in a ThreadPool.downloadFileToLocation(String urlStr, String pathToDownload) This method downloads the file asynchronously, executing it in a ThreadPool.downloadFileToLocation(String urlStr, Path path) This method downloads the file asynchronously, executing it in a ThreadPool.downloadObject(String urlStr) waitForDownloadFileToLocation(String urlStr, File file) This method downloads a file in the same thread in which it was called, locking it during the process.waitForDownloadFileToLocation(String urlStr, String file) This method downloads a file in the same thread in which it was called, locking it during the process.waitForDownloadFileToLocation(String urlStr, Path file) This method downloads a file in the same thread in which it was called, locking it during the process.
-
Constructor Details
-
Downloader
public Downloader()
-
-
Method Details
-
downloadFileToLocation
This method downloads the file asynchronously, executing it in a ThreadPool.- Parameters:
urlStr- Download URLfile- Where should the file be saved- Returns:
- The Download model contains relevant information and methods to assist in handling the process.
-
downloadFileToLocation
This method downloads the file asynchronously, executing it in a ThreadPool.- Parameters:
urlStr- Download URLpath- Where should the file be saved- Returns:
- The Download model contains relevant information and methods to assist in handling the process.
-
downloadFileToLocation
This method downloads the file asynchronously, executing it in a ThreadPool.- Parameters:
urlStr- Download URLpathToDownload- Where should the file be saved- Returns:
- The Download model contains relevant information and methods to assist in handling the process.
-
waitForDownloadFileToLocation
This method downloads a file in the same thread in which it was called, locking it during the process.
It can be useful if you want to stop the execution while the Download is not carried out.- Parameters:
urlStr- Download URLfile- Where should the file be saved- Returns:
- The Download model contains relevant information and methods to assist in handling the process.
-
waitForDownloadFileToLocation
This method downloads a file in the same thread in which it was called, locking it during the process.
It can be useful if you want to stop the execution while the Download is not carried out.- Parameters:
urlStr- Download URLfile- Where should the file be saved- Returns:
- The Download model contains relevant information and methods to assist in handling the process.
-
waitForDownloadFileToLocation
This method downloads a file in the same thread in which it was called, locking it during the process.
It can be useful if you want to stop the execution while the Download is not carried out.- Parameters:
urlStr- Download URLfile- Where should the file be saved- Returns:
- The Download model contains relevant information and methods to assist in handling the process.
-
downloadObject
-