@@ -228,6 +228,8 @@ public boolean hasNext() {
228228
229229 long [] rangeBoundsAtZoom = tileRange .rangeBounds (currentZoom );
230230 currentBlobIterator = client .listBlobs (zoomPrefix )
231+ .filter (tb ->
232+ TILE_BLOB_NAME_REGEXP .matcher (tb .getName ()).find ())
231233 .filter (tb -> isTileBlobInBounds (tb , rangeBoundsAtZoom ))
232234 .iterator ();
233235
@@ -254,6 +256,19 @@ public List<BlobItem> next() {
254256 return StreamSupport .stream (iterable .spliterator (), false );
255257 }
256258
259+ private boolean isTileBlobInBounds (BlobItem tileBlob , long [] bounds ) {
260+ long minX = bounds [0 ];
261+ long minY = bounds [1 ];
262+ long maxX = bounds [2 ];
263+ long maxY = bounds [3 ];
264+
265+ long [] index = extractTileIndex (tileBlob );
266+ long tileX = index [0 ];
267+ long tileY = index [1 ];
268+
269+ return tileX >= minX && tileX <= maxX && tileY >= minY && tileY <= maxY ;
270+ }
271+
257272 private void deleteTileBlobs (List <BlobItem > blobs , TileRange tileRange ) {
258273 try {
259274 if (listeners .isEmpty ()) {
@@ -287,19 +302,6 @@ private void deleteTileBlobs(List<BlobItem> blobs, TileRange tileRange) {
287302 }
288303 }
289304
290- private boolean isTileBlobInBounds (BlobItem tileBlob , long [] bounds ) {
291- long minX = bounds [0 ];
292- long minY = bounds [1 ];
293- long maxX = bounds [2 ];
294- long maxY = bounds [3 ];
295-
296- long [] index = extractTileIndex (tileBlob );
297- long tileX = index [0 ];
298- long tileY = index [1 ];
299-
300- return tileX >= minX && tileX <= maxX && tileY >= minY && tileY <= maxY ;
301- }
302-
303305 private TileObject createTileObject (BlobItem blobItem , TileRange tileRange ) {
304306 String layerName = tileRange .getLayerName ();
305307 String gridSetId = tileRange .getGridSetId ();
0 commit comments