us.zuercher.gpx2map.source
Class JavaDownloader
java.lang.Object
us.zuercher.gpx2map.source.JavaDownloader
- All Implemented Interfaces:
- Downloader
public class JavaDownloader
- extends Object
- implements Downloader
JavaDownloader is a pure-Java implementation of Downloader
. It uses
URL
to download files.
- Author:
- Stephan Zuercher
Field Summary |
private int |
BUFFER_SIZE
Stream buffer size in bytes. |
Method Summary |
void |
download(URL url,
File target)
Downloads a file from the given location to the given location. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BUFFER_SIZE
private int BUFFER_SIZE
- Stream buffer size in bytes.
JavaDownloader
public JavaDownloader()
download
public void download(URL url,
File target)
throws IOException
- Downloads a file from the given location to the given location.
- Specified by:
download
in interface Downloader
- Parameters:
url
- the source locationtarget
- the target file to store the downloaded file in
- Throws:
IOException
- if there is an error reading from the URL or
writing to the target file.