public class HttpDownloader extends Object implements Downloader, AuthAwareDownloader
DEFAULT_NAME
Constructor and Description |
---|
HttpDownloader() |
HttpDownloader(Optional<Proxy> proxy) |
Modifier and Type | Method and Description |
---|---|
protected HttpURLConnection |
createConnection(URI uri) |
boolean |
fetch(BuckEventBus eventBus,
URI uri,
Optional<PasswordAuthentication> authentication,
Path output) |
boolean |
fetch(BuckEventBus eventBus,
URI uri,
Path output)
Download the given URL and, upon a successful download, place it in
output . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
public boolean fetch(BuckEventBus eventBus, URI uri, Path output) throws IOException
Downloader
output
. Note that
if a Downloader
can't handle the URI.scheme
then false
will be
returned.fetch
in interface Downloader
IOException
- Should an exception be thrown when downloading.public boolean fetch(BuckEventBus eventBus, URI uri, Optional<PasswordAuthentication> authentication, Path output) throws IOException
fetch
in interface AuthAwareDownloader
IOException
protected HttpURLConnection createConnection(URI uri) throws IOException
IOException