updater.downloaders
Interface IDownloader
- All Known Implementing Classes:
- Downloader, ReliableDownloaderStub
public interface IDownloader
Manages downloading of files via HTTP.
download
void download(String url,
File localFile)
throws IOException,
FileNotFoundException,
MalformedURLException
- Parameters:
url
- A string specifying the URL of the remote file to download.localFile
- The path of the local file to save the remote file to.
- Throws:
IOException
- If the remote file cannot be downloaded.
FileNotFoundException
- If localFile cannot be created.
MalformedURLException
- If url is a malformed URL.- Requires:
- All parameters are non-null.
- Effects:
- Downloads the file at url and saves its contents
to file localFile, overwriting the file if already present.
downloadAsString
String downloadAsString(String url)
throws IOException
- Returns the contents of as a String.
- Parameters:
url
- A string specifying the URL of the remote file to download.
- Returns:
- The contents of url as a String.
- Throws:
IOException
- If the remote file cannot be downloaded.- Requires:
- url is non-null.
- Effects:
- Downloads the file at and returns its contents
as a String.
- Returns:
- A string with the contents of the remote file.