multipart.downloaders
Interface IDownloader

All Known Implementing Classes:
CannedDownloaderStub, Downloader

public interface IDownloader

Manages downloading of files via HTTP.


Method Summary
 void download(java.lang.String url, java.io.OutputStream dest)
          Downloads the file at url and outputs its contents to dest.
 java.lang.String downloadAsString(java.lang.String url)
          Returns the contents of url as a String.
 

Method Detail

download

void download(java.lang.String url,
              java.io.OutputStream dest)
              throws java.io.IOException,
                     java.net.MalformedURLException
Downloads the file at url and outputs its contents to dest.

Parameters:
url - A string specifying the URL of the remote file to download.
dest - The output destination for the downloaded data.
Throws:
java.io.IOException - If the remote file cannot be downloaded.
java.net.MalformedURLException - If url is a malformed URL.

downloadAsString

java.lang.String downloadAsString(java.lang.String url)
                                  throws java.io.IOException,
                                         java.net.MalformedURLException
Returns the contents of url as a String.

Parameters:
url - A string specifying the URL of the remote file to download.
Returns:
A string with the contents of the remote file.
Throws:
java.io.IOException - If the remote file cannot be downloaded.
java.net.MalformedURLException - If url is a malformed URL.