Error when EOF prematurely reached (#1238)

* error when EOF prematurely reached

* point at official sources
pull/1236/head
Michael Barry 2025-04-05 21:29:18 -04:00 zatwierdzone przez GitHub
rodzic b28e1ea555
commit faf557be2d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 20 dodań i 3 usunięć

Wyświetl plik

@ -296,6 +296,9 @@ public class Downloader {
offset += written;
}
}
if (offset < range.end && range.end != Long.MAX_VALUE) {
throw new IllegalStateException("Unexpected EOF at " + offset + " expecting " + range.end);
}
} finally {
perFileLimiter.release();
}

Wyświetl plik

@ -20,6 +20,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.stream.Stream;
import org.openmaptiles.OpenMapTilesMain;
import org.openmaptiles.OpenMapTilesProfile;
import org.openmaptiles.util.VerifyMonaco;
/**
@ -37,10 +38,23 @@ public class Main {
}
}
private static final EntryPoint DEFAULT_TASK = OpenMapTilesMain::main;
private static final EntryPoint OPENMAPTILES = args -> {
// override default sources to fix download issues with maptiler URLs
String[] withDefaultArgs = Stream.concat(
Stream.of(
"--" + OpenMapTilesProfile.LAKE_CENTERLINE_SOURCE + "-url",
"https://github.com/acalcutt/osm-lakelines/releases/download/v12/lake_centerline.shp.zip",
"--" + OpenMapTilesProfile.NATURAL_EARTH_SOURCE + "-url",
"https://naciscdn.org/naturalearth/packages/natural_earth_vector.sqlite.zip"
),
Stream.of(args)
).toArray(String[]::new);
OpenMapTilesMain.main(withDefaultArgs);
};
private static final EntryPoint DEFAULT_TASK = OPENMAPTILES;
private static final Map<String, EntryPoint> ENTRY_POINTS = Map.ofEntries(
entry("generate-openmaptiles", OpenMapTilesMain::main),
entry("openmaptiles", OpenMapTilesMain::main),
entry("generate-openmaptiles", OPENMAPTILES),
entry("openmaptiles", OPENMAPTILES),
entry("generate-custom", ConfiguredMapMain::main),
entry("custom", ConfiguredMapMain::main),