Throw Exception in checkFileIntegrity on failure

DownloadWorker didn't check the string return value which should detect
failed downloads. Throwing (checked) exceptions simplifies error
handling in DownloadWorker.
This commit is contained in:
Manuel Fuhr 2022-04-04 13:09:34 +02:00
parent f0df9f94d4
commit 02eddeff81
3 changed files with 13 additions and 22 deletions

View file

@ -35,7 +35,7 @@ final class OsmFile
private int ncaches;
private int indexsize;
public OsmFile( PhysicalFile rafile, int lonDegree, int latDegree, DataBuffers dataBuffers ) throws Exception
public OsmFile( PhysicalFile rafile, int lonDegree, int latDegree, DataBuffers dataBuffers ) throws IOException
{
this.lonDegree = lonDegree;
this.latDegree = latDegree;
@ -111,7 +111,7 @@ final class OsmFile
return idx == -1 ? indexsize : posIdx[idx];
}
public int getDataInputForSubIdx( int subIdx, byte[] iobuffer ) throws Exception
public int getDataInputForSubIdx( int subIdx, byte[] iobuffer ) throws IOException
{
int startPos = getPosIdx( subIdx - 1 );
int endPos = getPosIdx( subIdx );
@ -128,7 +128,7 @@ final class OsmFile
}
public MicroCache createMicroCache( int lonIdx, int latIdx, DataBuffers dataBuffers, TagValueValidator wayValidator,
WaypointMatcher waypointMatcher, boolean reallyDecode, OsmNodesMap hollowNodes ) throws Exception
WaypointMatcher waypointMatcher, boolean reallyDecode, OsmNodesMap hollowNodes ) throws IOException
{
int subIdx = ( latIdx - divisor * latDegree ) * divisor + ( lonIdx - divisor * lonDegree );