|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmultipart.downloaders.Downloader
public class Downloader
Implements the IDownloader interface using a URLConnection.
Constructor Summary | |
---|---|
Downloader()
Creates a new instance of Downloader |
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Downloader()
Method Detail |
---|
public void download(java.lang.String url, java.io.OutputStream dest) throws java.net.MalformedURLException, java.io.IOException
IDownloader
download
in interface IDownloader
url
- A string specifying the URL of the remote file to download.dest
- The output destination for the downloaded data.
java.net.MalformedURLException
- If url is a malformed URL.
java.io.IOException
- If the remote file cannot be downloaded.public java.lang.String downloadAsString(java.lang.String url) throws java.net.MalformedURLException, java.io.IOException
IDownloader
downloadAsString
in interface IDownloader
url
- A string specifying the URL of the remote file to download.
java.net.MalformedURLException
- If url is a malformed URL.
java.io.IOException
- If the remote file cannot be downloaded.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |