public class Downloader
extends java.lang.Object
Constructor and Description |
---|
Downloader() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
downloadFromHttpServer(java.net.URL url)
Download the given URL from an HTTP server and return downloaded bytes.
|
static byte[] |
downloadFromHttpServer(java.net.URL url,
boolean isDeflated)
Download the given URL from an HTTP server, possibly inflate the response,
and return downloaded bytes.
|
public static byte[] downloadFromHttpServer(java.net.URL url) throws java.io.IOException
url
- URL to download.null
if the resource was not found.java.io.IOException
- Thrown if anything goes wrong while downloading.public static byte[] downloadFromHttpServer(java.net.URL url, boolean isDeflated) throws java.io.IOException
url
- URL to download.isDeflated
- Whether the response is deflated.null
if the resource was not found.java.io.IOException
- Thrown if anything goes wrong while downloading.