private static URLConnection getUrlConnection(String urlString, PlanetilerConfig config) throws IOException {
    var url = URI.create(urlString).toURL();
    var connection = url.openConnection();
    connection.setConnectTimeout((int) config.httpTimeout().toMillis());
    connection.setReadTimeout((int) config.httpTimeout().toMillis());
    connection.setRequestProperty(USER_AGENT, config.httpUserAgent());
    return connection;
  }
A utility for downloading files to disk in parallel over HTTP.
<p>
After downloading a file once, it won't be downloaded again unless the {@code Content-Length} of the resource
changes.
<p>
For example:
{@snippet :
Downloader.create(PlanetilerConfig.defaults())
  .add("natural_earth", "http://url/of/natural_earth.zip", Path.of("natural_earth.zip"))
  .add("osm", "http://url/of/file.osm.pbf", Path.of("file.osm.pbf"))
  .run();
}
<p>
As a shortcut to find the URL of a file to download from the <a href="https://download.geofabrik.de/">Geofabrik
download site</a>, you can use "geofabrik:extract name" (i.e. "geofabrik:monaco" or "geofabrik:australia") to look up
a {@code .osm.pbf} download URL in the <a href="https://download.geofabrik.de/technical.html">Geofabrik JSON
index</a>.
<p>
Use "aws:latest" to download the latest {@code planet.osm.pbf} file from the
<a href="https://registry.opendata.aws/osm/">AWS Open Data Registry</a>, or "overture:latest" to download the latest
<a href="https://overturemaps.org/">Overture Maps Foundation</a> release.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/Downloader.java