public abstract class BoundsDownloadRunnable extends Object implements Runnable
Constructor and Description |
---|
BoundsDownloadRunnable(Bounds bounds) |
Modifier and Type | Method and Description |
---|---|
protected abstract Function<Bounds,URL> |
getUrlGenerator() |
static void |
logConnectionInfo(URLConnection con,
String info)
Logs information about the given connection via
Logging.info(String) . |
void |
run() |
abstract void |
run(URLConnection connection) |
public BoundsDownloadRunnable(Bounds bounds)
protected abstract Function<Bounds,URL> getUrlGenerator()
public static void logConnectionInfo(URLConnection con, String info) throws IOException
Logging.info(String)
.
If it's a HttpURLConnection
, the request method, the response code and the URL itself are logged.
Otherwise only the URL is logged.con
- the URLConnection
for which information is loggedinfo
- an additional info text, which is appended to the output in bracesIOException
- if HttpURLConnection.getResponseCode()
throws an IOException
public abstract void run(URLConnection connection) throws IOException
IOException