| java.lang.Object org.netbeans.installer.sandbox.download.DownloadManager
DownloadManager | public class DownloadManager (Code) | | This class serves as a single entry point for the download module. Clients should
use the instance of this class to initiate downloads instead of addressing the
Download class directly. DownloadManager provides means
to initiate downloads in both blocking and non blocking modes.
This class is also responsible for managing proxies. Connections are expected to
address the DownloadManager in order to get the list of proxies that
they should use to connect to remote machines.
author: Kirill Sorokin |
Inner Class :public static class DownloadHandler extends DownloadAdapter | |
Method Summary | |
public void | addProxy(Proxy proxy) Registers a new proxy with the DownloadManager . | public File | download(URI uri, File file, DownloadOptions options) Performs a download in blocking mode. | public File | download(String uri, File file, DownloadOptions options) Performs a download in blocking mode.
Parameters: uri - The source URI. Parameters: file - The destination file. Parameters: options - The options for the download. throws: org.netbeans.installer.utils.exceptions.DownloadException - if thedownload fails for whatever reason. | public File | download(String uri, File file) | public File | download(URI uri, DownloadOptions options) Performs a download in blocking mode.
Parameters: uri - The source URI. Parameters: options - The options for the download. throws: org.netbeans.installer.utils.exceptions.DownloadException - if thedownload fails for whatever reason. | public File | download(String uri, DownloadOptions options) Performs a download in blocking mode.
Parameters: uri - The source URI. Parameters: options - The options for the download. throws: org.netbeans.installer.utils.exceptions.DownloadException - if thedownload fails for whatever reason. | public File | download(URI uri) Performs a download in blocking mode.
Parameters: uri - The source URI. throws: org.netbeans.installer.utils.exceptions.DownloadException - if thedownload fails for whatever reason. | public File | download(String uri) Performs a download in blocking mode.
Parameters: uri - The source URI. throws: org.netbeans.installer.utils.exceptions.DownloadException - if thedownload fails for whatever reason. | public Download | getDownload(URI uri, File file, DownloadOptions options, DownloadListener listener) Constructs an instance of Download . | public Download | getDownload(URI uri, File file, DownloadOptions options) Constructs an instance of Download . | public Download | getDownload(String uri, String filename, DownloadOptions options, DownloadListener listener) Constructs an instance of Download . | public Download | getDownload(String uri, String filename, DownloadOptions options) Constructs an instance of Download . | public static synchronized DownloadManager | getInstance() Returns the instance of DownloadManager . | public List<Proxy> | getProxies(ProxyType type) Returns a list of registered proxies of the given type.
Parameters: type - The type of proxies to return. | public void | removeProxy(Proxy proxy) Removes a proxy from the list of registered proxies. |
addProxy | public void addProxy(Proxy proxy)(Code) | | Registers a new proxy with the DownloadManager .
Parameters: proxy - The proxy to register. |
download | public File download(URI uri, File file, DownloadOptions options) throws DownloadException(Code) | | Performs a download in blocking mode. This method provides support for
caching. To enable it the client must explicitly define it in the download
options. The same download options property is used for both enabling cache
hits and completed download registration in the cache.
Parameters: uri - The source URI. Parameters: file - The destination file. Parameters: options - The options for the download. throws: org.netbeans.installer.utils.exceptions.DownloadException - if thedownload fails for whatever reason. The destination file. |
getDownload | public Download getDownload(URI uri, File file, DownloadOptions options, DownloadListener listener)(Code) | | Constructs an instance of Download . This method should be used
by the clients wishing to initiate a download in non-blocking mode.
Parameters: uri - The source URI. Parameters: file - The destination file. Parameters: options - The options for the download. Parameters: listener - The initial download listener. An instance of Download constructed according to thesupplied parameters. |
getDownload | public Download getDownload(URI uri, File file, DownloadOptions options)(Code) | | Constructs an instance of Download . This method should be used
by the clients wishing to initiate a download in non-blocking mode.
Parameters: uri - The source URI. Parameters: file - The destination file. Parameters: options - The options for the download. An instance of Download constructed according to thesupplied parameters. |
getDownload | public Download getDownload(String uri, String filename, DownloadOptions options, DownloadListener listener) throws URISyntaxException(Code) | | Constructs an instance of Download . This method should be used
by the clients wishing to initiate a download in non-blocking mode.
Parameters: uri - The source URI. Parameters: filename - The destination file name. Parameters: options - The options for the download. Parameters: listener - The initial download listener. An instance of Download constructed according to thesupplied parameters. throws: java.net.URISyntaxException - if the supplied string cannot be parsedinto an URI . |
getDownload | public Download getDownload(String uri, String filename, DownloadOptions options) throws URISyntaxException(Code) | | Constructs an instance of Download . This method should be used
by the clients wishing to initiate a download in non-blocking mode.
Parameters: uri - The source URI. Parameters: filename - The destination file name. Parameters: options - The options for the download. An instance of Download constructed according to thesupplied parameters. throws: java.net.URISyntaxException - if the supplied string cannot be parsedinto an URI . |
getInstance | public static synchronized DownloadManager getInstance()(Code) | | Returns the instance of DownloadManager . If the instance does
not yet exist it is constructed.
The instance of DownloadManager |
getProxies | public List<Proxy> getProxies(ProxyType type)(Code) | | Returns a list of registered proxies of the given type.
Parameters: type - The type of proxies to return. The list of proxies of the given type. |
removeProxy | public void removeProxy(Proxy proxy)(Code) | | Removes a proxy from the list of registered proxies.
Parameters: proxy - The proxy to remove. |
|
|