Buggy code:
public class TmsReader extends TmsTileStore implements TileStoreReader { public TmsReader ( final CrsProfile profile , final Path location ) { } @ Override public BoundingBox getBounds ( ) throws TileStoreException { } @ Override public long countTiles ( ) { } @ Override public long getByteSize ( ) throws TileStoreException { } @ Override public BufferedImage getTile ( final int row , final int column , final int zoomLevel ) throws TileStoreException { } @ Override public BufferedImage getTile ( final CrsCoordinate coordinate , final int zoomLevel ) throws TileStoreException { } @ Override public Set < Integer > getZoomLevels ( ) throws TileStoreException { } @ Override public Stream < TileHandle > stream ( ) { } @ Override public CoordinateReferenceSystem getCoordinateReferenceSystem ( ) { } @ Override public String getImageType ( ) { } @ Override public Dimensions getImageDimensions ( ) { } private static class Range { public Range ( final int minimum , final int maximum ) { } public int minimum ; public int maximum ; } private void calculateBounds ( ) throws TileStoreException { } private long countFiles ( final File directory ) { } private long calculateStoreSize ( ) throws IOException { } private void calculateZoomLevels ( ) { } private TileHandle getTileHandle ( final Path path ) { final File file = path . toFile ( ) ; <START_BUG> final String absolutePath = file . getAbsolutePath ( ) ; <END_BUG> final Matcher tmsFileMatch = TmsReader . TmsFilePattern . matcher ( absolutePath ) ; if ( tmsFileMatch . matches ( ) ) { try { final MimeType mimeType = new MimeType ( Files . probeContentType ( path ) ) ; if ( mimeType . getPrimaryType ( ) . toLowerCase ( ) . equals ( "image" ) ) { final int zoomLevel = Integer . parseInt ( tmsFileMatch . group ( 1 ) ) ; final int column = Integer . parseInt ( tmsFileMatch . group ( 2 ) ) ; final int row = Integer . parseInt ( tmsFileMatch . group ( 3 ) ) ; return new TileHandle ( ) { private final boolean gotImage = false ; private BufferedImage image ; private final TileMatrixDimensions matrix = TmsReader . this . tileScheme . dimensions ( zoomLevel ) ; @ Override public int getZoomLevel ( ) { return zoomLevel ; } @ Override public int getColumn ( ) { return column ; } @ Override public int getRow ( ) { return row ; } @ Override public TileMatrixDimensions getMatrix ( ) throws TileStoreException { return this . matrix ; } @ Override public BoundingBox getBounds ( ) throws TileStoreException { final Coordinate < Double > lowerLeft = TmsReader . this . profile . tileToCrsCoordinate ( row , column , TmsReader . this . profile . getBounds ( ) , this . matrix , Origin ) ; final Coordinate < Double > upperRight = TmsReader . this . profile . tileToCrsCoordinate ( ( row + 1 ) , ( column + 1 ) , TmsReader . this . profile . getBounds ( ) , this . matrix , Origin ) ; return new BoundingBox ( lowerLeft . getY ( ) , lowerLeft . getX ( ) , upperRight . getY ( ) , upperRight . getX ( ) ) ; } @ Override public BufferedImage getImage ( ) throws TileStoreException { if ( ! ( this . gotImage ) ) { this . image = TmsReader . this . getTile ( row , column , zoomLevel ) ; } return this . image ; } } ; } } catch ( MimeTypeParseException | IOException ex ) { } } return null ; } private static TmsReader . Range getTmsRange ( final File directory ) throws TileStoreException { } private Stream < File > getTiles ( final int row , final int column , final int zoomLevel ) { } private static boolean fileIsImage ( final File file ) { } private static String withoutExtension ( final File file ) { } private Set < Integer > zoomLevels = null ; private BoundingBox bounds = null ; private long tileCount = - 1 ; private long storeSize = - 1 ; private static Pattern TmsFilePattern = Pattern . compile ( "[^0-9]*([0-9]+)//([0-9]+)//([0-9]+)\\.[^//]*$" ) ; }

Fix:
final String absolutePath = file . getAbsolutePath ( ) . replace ( '\\' , '//' ) ;