us.zuercher.gpx2map.source
Class JavaDownloader

java.lang.Object
  extended by 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.
 
Constructor Summary
JavaDownloader()
           
 
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
 

Field Detail

BUFFER_SIZE

private int BUFFER_SIZE
Stream buffer size in bytes.

Constructor Detail

JavaDownloader

public JavaDownloader()
Method Detail

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 location
target - 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.